PHP_UML is structured in 5 packages:

  • the main package, which contains the public class (PHP_UML), and some utility classes
  • the package PHP, in charge of reading and parsing the PHP code
  • the package Metamodel, which contains the data structures that PHP_UML is using to modelize the code parsed
  • the package XMI, which contains classes that can serialize a metamodel into XMI code
  • the package Output, which contains the necessary stuff (like XSL stylesheets) to transform an XMI file into another format (HTML for example)

You got it: PHP_UML, as it is analyzing the PHP files, creates a hierarchy of objects to represent the structure of the code. The whole thing forms a metamodel.
Once all the PHP files have been parsed, PHP_UML finalizes this metamodel, by creating all the necessary links between the interdependent objects (inheriting class, implementing class, explicit type hint in a parameter of a function…)
Then, PHP_UML serializes this metamodel to XMI with an implementation class (depending on the desired XMI version, 1 or 2).
PHP_UML can also apply complex XSL transformations to some XMI data (data it has generated itself, or from a given file), in order to generate either an HTML API documentation, or some PHP code stubs.

By separating the problems (code parsing / production of an abstract metamodel / exploitation of the metamodel), we have made the PHP_UML application easier to maintain, to evolve, and to be reused.