Transformer
Core class responsible for transforming the cache file to a set of artifacts.
Interfaces, Classes & Used Traits
- CompilerPassInterface
- Represents a single pass / business rule to be executed by the Compiler.
Constants
EVENT_PRE_TRANSFORMATION Line 42
mixed EVENT_PRE_TRANSFORMATION = 'transformer.transformation.pre'
EVENT_POST_TRANSFORMATION Line 44
mixed EVENT_POST_TRANSFORMATION = 'transformer.transformation.post'
EVENT_PRE_INITIALIZATION Line 46
mixed EVENT_PRE_INITIALIZATION = 'transformer.writer.initialization.pre'
EVENT_POST_INITIALIZATION Line 48
mixed EVENT_POST_INITIALIZATION = 'transformer.writer.initialization.post'
EVENT_PRE_TRANSFORM Line 50
mixed EVENT_PRE_TRANSFORM = 'transformer.transform.pre'
EVENT_POST_TRANSFORM Line 52
mixed EVENT_POST_TRANSFORM = 'transformer.transform.post'
COMPILER_PRIORITY Line 55
int COMPILER_PRIORITY = 5000
Properties
$target Line 58
protected$target : string|null
$templates Line 64
protected$templates : \phpDocumentor\Transformer\Template\Collection
$writers Line 67
protected$writers : \phpDocumentor\Transformer\Writer\Collection
$transformations Line 70
protected$transformations : \phpDocumentor\Transformer\Transformation[]
$destination Line 61
private$destination : \League\Flysystem\FilesystemInterface|null
$logger Line 73
private$logger : \Psr\Log\LoggerInterface
$flySystemFactory Line 76
private$flySystemFactory : \phpDocumentor\Parser\FlySystemFactory
Methods
__construct() Line 81
Wires the template collection and writer collection to this transformer.
public__construct(Collection $templateCollection, Collection $writerCollection, LoggerInterface $logger, FlySystemFactory $flySystemFactory) : mixed
Parameters
Returns
mixed —
getDescription() Line 93
Returns a textual description of what this pass does for output purposes.
publicgetDescription() : string
Please note that the command line will be truncated to 68 characters (
Returns
string —
setTarget() Line 103
Sets the target location where to output the artifacts.
publicsetTarget(string $target) : void
Parameters
The target location where to output the artifacts.
getTarget() Line 112
Returns the location where to store the artifacts.
publicgetTarget() : string|null
Returns
string|null —
destination() Line 117
publicdestination() : FilesystemInterface
Returns
FilesystemInterface —
getTemplatesDirectory() Line 122
publicgetTemplatesDirectory() : Filesystem
Returns
Filesystem —
getTemplates() Line 139
Returns the list of templates which are going to be adopted.
publicgetTemplates() : Collection
execute() Line 147
Transforms the given project into a series of artifacts as provided by the templates.
publicexecute(ProjectDescriptor $project) : void
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.
log() Line 176
Dispatches a logging request.
publiclog(string $message[, string $priority = LogLevel::INFO ]) : void
This method can be used by writers to output logs without having to know anything about the logging mechanism of phpDocumentor.
Parameters
debug() Line 187
Dispatches a logging request to log a debug message.
publicdebug(string $message) : void
This method can be used by writers to output logs without having to know anything about the logging mechanism of phpDocumentor.
Parameters
initializeWriters() Line 197
Initializes all writers that are used during this transformation.
privateinitializeWriters(ProjectDescriptor $project, \phpDocumentor\Transformer\Transformation[] $transformations) : void
Parameters
initializeWriter() Line 229
Initializes the given writer using the provided project meta-data.
privateinitializeWriter(WriterAbstract $writer, ProjectDescriptor $project) : void
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:
- transformer.writer.initialization.pre, before the initialization of a single writer.
- transformer.writer.initialization.post, after the initialization of a single writer.
transformProject() Line 248
Applies all given transformations to the provided project.
privatetransformProject(ProjectDescriptor $project, \phpDocumentor\Transformer\Transformation[] $transformations) : void
Parameters
applyTransformationToProject() Line 269
Applies the given transformation to the provided project.
privateapplyTransformationToProject(Transformation $transformation, ProjectDescriptor $project) : void
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:
- transformer.transformation.pre, before the project has been transformed with this transformation.
- transformer.transformation.post, after the project has been transformed with this transformation