Constants

EVENT_PRE_TRANSFORMATION

EVENT_PRE_TRANSFORMATION = 'transformer.transformation.pre'

EVENT_POST_TRANSFORMATION

EVENT_POST_TRANSFORMATION = 'transformer.transformation.post'

EVENT_PRE_INITIALIZATION

EVENT_PRE_INITIALIZATION = 'transformer.writer.initialization.pre'

EVENT_POST_INITIALIZATION

EVENT_POST_INITIALIZATION = 'transformer.writer.initialization.post'

EVENT_PRE_TRANSFORM

EVENT_PRE_TRANSFORM = 'transformer.transform.pre'

EVENT_POST_TRANSFORM

EVENT_POST_TRANSFORM = 'transformer.transform.post'

COMPILER_PRIORITY

COMPILER_PRIORITY = 5000 : int

Properties

$target

$target : string|null

Type

string|null — Target location where to output the artifacts

$writers

$writers : \phpDocumentor\Transformer\Writer\Collection

Type

Collection

$destination

$destination : \League\Flysystem\FilesystemInterface|null

Type

FilesystemInterface|null — The destination filesystem to write to

$logger

$logger : \Psr\Log\LoggerInterface

Type

\Psr\Log\LoggerInterface —

$flySystemFactory

$flySystemFactory : \phpDocumentor\Parser\FlySystemFactory

Type

FlySystemFactory

$eventDispatcher

$eventDispatcher : \Symfony\Contracts\EventDispatcher\EventDispatcherInterface

Type

\Symfony\Contracts\EventDispatcher\EventDispatcherInterface —

Methods

__construct()

__construct(\phpDocumentor\Transformer\Writer\Collection  $writerCollection, \Psr\Log\LoggerInterface  $logger, \phpDocumentor\Parser\FlySystemFactory  $flySystemFactory, \Symfony\Contracts\EventDispatcher\EventDispatcherInterface  $eventDispatcher) : mixed

Wires the template collection and writer collection to this transformer.

Parameters

\phpDocumentor\Transformer\Writer\Collection $writerCollection
\Psr\Log\LoggerInterface $logger
\phpDocumentor\Parser\FlySystemFactory $flySystemFactory
\Symfony\Contracts\EventDispatcher\EventDispatcherInterface $eventDispatcher

Returns

mixed —

getDescription()

getDescription() : string

Returns

string —

setTarget()

setTarget(string  $target) : void

Sets the target location where to output the artifacts.

Parameters

string $target

The target location where to output the artifacts.

getTarget()

getTarget() : ?string

Returns the location where to store the artifacts.

Returns

?string —

setDestination()

setDestination(\League\Flysystem\FilesystemInterface  $filesystem) : void

Parameters

\League\Flysystem\FilesystemInterface $filesystem

destination()

destination() : \League\Flysystem\FilesystemInterface

Returns

\League\Flysystem\FilesystemInterface —

execute()

execute(\phpDocumentor\Descriptor\ProjectDescriptor  $project, \phpDocumentor\Transformer\Transformation[]  $transformations) : void

Transforms the given project into a series of artifacts as provided by the templates.

Parameters

\phpDocumentor\Descriptor\ProjectDescriptor $project
\phpDocumentor\Transformer\Transformation[] $transformations

initializeWriters()

initializeWriters(\phpDocumentor\Descriptor\ProjectDescriptor  $project, \phpDocumentor\Transformer\Transformation[]  $transformations) : void

Initializes all writers that are used during this transformation.

Parameters

\phpDocumentor\Descriptor\ProjectDescriptor $project
\phpDocumentor\Transformer\Transformation[] $transformations

initializeWriter()

initializeWriter(\phpDocumentor\Transformer\Writer\WriterAbstract  $writer, \phpDocumentor\Descriptor\ProjectDescriptor  $project, \phpDocumentor\Transformer\Template  $template) : 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:

  • transformer.writer.initialization.pre, before the initialization of a single writer.
  • transformer.writer.initialization.post, after the initialization of a single writer.

Parameters

\phpDocumentor\Transformer\Writer\WriterAbstract $writer
\phpDocumentor\Descriptor\ProjectDescriptor $project
\phpDocumentor\Transformer\Template $template

transformProject()

transformProject(\phpDocumentor\Descriptor\ProjectDescriptor  $project, \phpDocumentor\Transformer\Transformation[]  $transformations) : void

Applies all given transformations to the provided project.

Parameters

\phpDocumentor\Descriptor\ProjectDescriptor $project
\phpDocumentor\Transformer\Transformation[] $transformations

applyTransformationToProject()

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:

  • transformer.transformation.pre, before the project has been transformed with this transformation.
  • transformer.transformation.post, after the project has been transformed with this transformation

Parameters

\phpDocumentor\Transformer\Transformation $transformation
\phpDocumentor\Descriptor\ProjectDescriptor $project