EVENT_PRE_TRANSFORMATION
EVENT_PRE_TRANSFORMATION = 'transformer.transformation.pre'
Core class responsible for transforming the cache file to a set of artifacts.
$templates : \phpDocumentor\Transformer\Template\Collection
$writers : \phpDocumentor\Transformer\Writer\Collection|array<mixed,\phpDocumentor\Transformer\Writer\WriterAbstract>
$transformations : array<mixed,\phpDocumentor\Transformer\Transformation>
__construct(\phpDocumentor\Transformer\Template\Collection $templateCollection, \phpDocumentor\Transformer\Writer\Collection $writerCollection)
Wires the template collection and writer collection to this transformer.
\phpDocumentor\Transformer\Template\Collection | $templateCollection | |
\phpDocumentor\Transformer\Writer\Collection | $writerCollection |
getTemplates() : \phpDocumentor\Transformer\Template\Collection
Returns the list of templates which are going to be adopted.
execute(\phpDocumentor\Descriptor\ProjectDescriptor $project) : void
Transforms the given project into a series of artifacts as provided by the templates.
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. |
generateFilename(string $name) : string
Converts a source file name to the name used for generating the end result.
This method strips down the given $name using the following rules:
string | $name | Name to convert. |
initializeWriters(\phpDocumentor\Descriptor\ProjectDescriptor $project, array<mixed,\phpDocumentor\Transformer\Transformation> $transformations) : void
Initializes all writers that are used during this transformation.
\phpDocumentor\Descriptor\ProjectDescriptor | $project | |
array<mixed,\phpDocumentor\Transformer\Transformation> | $transformations |
initializeWriter(\phpDocumentor\Transformer\Writer\WriterAbstract $writer, \phpDocumentor\Descriptor\ProjectDescriptor $project) : void
Initializes the given writer using the provided project meta-data.
This method wil call for the initialization of each writer that supports an initialization routine (as defined by
the Initializable
interface).
In addition to this, the following events emitted for each writer that is present in the collected list of
transformations, even those that do not implement the Initializable
interface.
Emitted events:
\phpDocumentor\Transformer\Writer\WriterAbstract | $writer | |
\phpDocumentor\Descriptor\ProjectDescriptor | $project |
transformProject(\phpDocumentor\Descriptor\ProjectDescriptor $project, array<mixed,\phpDocumentor\Transformer\Transformation> $transformations) : void
Applies all given transformations to the provided project.
\phpDocumentor\Descriptor\ProjectDescriptor | $project | |
array<mixed,\phpDocumentor\Transformer\Transformation> | $transformations |
applyTransformationToProject(\phpDocumentor\Transformer\Transformation $transformation, \phpDocumentor\Descriptor\ProjectDescriptor $project) : void
Applies the given transformation to the provided project.
This method will attempt to find an appropriate writer for the given transformation and invoke that with the transformation and project so that an artifact can be generated that matches the intended transformation.
In addition this method will emit the following events:
\phpDocumentor\Transformer\Transformation | $transformation | |
\phpDocumentor\Descriptor\ProjectDescriptor | $project |