COMPILER_PRIORITY
COMPILER_PRIORITY = 9000
Rebuilds the namespace tree from the elements found in files.
On every compiler pass is the namespace tree rebuild to aid in the process of incremental updates. The Files Collection in the Project Descriptor is the only location where aliases to elements may be serialized.
If the namespace tree were to be persisted then both locations needed to be invalidated if a file were to change.
execute(\phpDocumentor\Descriptor\ProjectDescriptor $project) : mixed
Executes a compiler pass.
This method will execute the business logic associated with a given compiler pass and allow it to manipulate or consumer the Object Graph using the ProjectDescriptor object.
\phpDocumentor\Descriptor\ProjectDescriptor | $project | Representation of the Object Graph that can be manipulated. |
addElementsOfTypeToNamespace(\phpDocumentor\Descriptor\ProjectDescriptor $project, array<mixed,\phpDocumentor\Descriptor\DescriptorAbstract> $elements, string $type) : void
Adds the given elements of a specific type to their respective Namespace Descriptors.
This method will assign the given elements to the namespace as registered in the namespace field of that element. If a namespace does not exist yet it will automatically be created.
\phpDocumentor\Descriptor\ProjectDescriptor | $project | |
array<mixed,\phpDocumentor\Descriptor\DescriptorAbstract> | $elements | Series of elements to add to their respective namespace. |
string | $type | Declares which field of the namespace will be populated with the given series of elements. This name will be transformed to a getter which must exist. Out of performance considerations will no effort be done to verify whether the provided type is valid. |
createNamespaceDescriptorTree(\phpDocumentor\Descriptor\ProjectDescriptor $project, string $namespaceName) : void
Creates a tree of NamespaceDescriptors based on the provided FQNN (namespace name).
This method will examine the namespace name and create a namespace descriptor for each part of the FQNN if it doesn't exist in the namespaces field of the current namespace (starting with the root Namespace in the Project Descriptor),
As an intended side effect this method also populates the elements index of the ProjectDescriptor with all created NamespaceDescriptors. Each index key is prefixed with a tilde (~) so that it will not conflict with other FQSEN's, such as classes or interfaces.
\phpDocumentor\Descriptor\ProjectDescriptor | $project | |
string | $namespaceName | A FQNN of the namespace (and parents) to create. |