Constants

EVENT_PRE_TRANSFORMATION

EVENT_PRE_TRANSFORMATION

EVENT_POST_TRANSFORMATION

EVENT_POST_TRANSFORMATION

EVENT_PRE_INITIALIZATION

EVENT_PRE_INITIALIZATION

EVENT_POST_INITIALIZATION

EVENT_POST_INITIALIZATION

EVENT_PRE_TRANSFORM

EVENT_PRE_TRANSFORM

EVENT_POST_TRANSFORM

EVENT_POST_TRANSFORM

COMPILER_PRIORITY

COMPILER_PRIORITY

Properties

$target

$target : string|null

Type

string|null — Target location where to output the artifacts

Methods

getDescription()

getDescription() : string

Returns a textual description of what this pass does for output purposes.

Please note that the command line will be truncated to 68 characters ( .. 000.000s) so longer descriptions won't have much use.

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.

Throws

\InvalidArgumentException

if the target is not a valid writable directory.

getTarget()

getTarget() : string

Returns the location where to store the artifacts.

Returns

string

execute()

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.

Parameters

\phpDocumentor\Descriptor\ProjectDescriptor $project

Representation of the Object Graph that can be manipulated.

generateFilename()

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:

  • if the $name is suffixed with .php then that is removed
  • any occurrence of \ or DIRECTORY_SEPARATOR is replaced with .
  • any dots that the name starts or ends with is removed
  • the result is suffixed with .html

Parameters

string $name

Name to convert.

Returns

string

log()

log(string  $message, string  $priority = \Psr\Log\LogLevel::INFO) : void

Dispatches a logging request.

Parameters

string $message

The message to log.

string $priority

The logging priority

debug()

debug(string  $message) : void

Dispatches a logging request to log a debug message.

Parameters

string $message

The message to log.

initializeWriter()

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:

  • 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

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