\phpDocumentor\TransformerTransformation

Class representing a single Transformation.

Summary

Methods
Properties
Constants
__construct()
setQuery()
getQuery()
setWriter()
getWriter()
setSource()
getSource()
getSourceAsPath()
setArtifact()
getArtifact()
setParameters()
getParameters()
getParameter()
getParametersWithKey()
setTransformer()
getTransformer()
No public properties found
No constants found
No protected methods found
$writer
$artifact
$source
$query
$transformer
$parameters
N/A
No private methods found
No private properties found
N/A

Properties

$writer

$writer : string

Type

string — Reference to an object containing the business logic used to execute this transformation.

$artifact

$artifact : string

Type

string — the location where the output should be sent to; the exact function differs per writer.

$source

$source : string

Type

string — the location where input for a writer should come from; the exact function differs per writer.

$query

$query : string

Type

string — a filter or other form of limitation on what information of the AST is used; the exact function differs per writer.

$transformer

$transformer : \phpDocumentor\Transformer\Transformer

Type

\phpDocumentor\Transformer\Transformer — The object guiding the transformation process and having meta-data of it.

$parameters

$parameters : array<mixed,\phpDocumentor\Transformer\Template\Parameter>

Type

array<mixed,\phpDocumentor\Transformer\Template\Parameter> — A series of parameters that can influence what the writer does; the exact function differs per writer.

Methods

__construct()

__construct(string  $query, string  $writer, string  $source, string  $artifact) 

Constructs a new Transformation object and populates the required parameters.

Parameters

string $query

What information to use as datasource for the writer's source.

string $writer

What type of transformation to apply (XSLT, PDF, Checkstyle etc).

string $source

Which template or type of source to use.

string $artifact

What is the filename of the result (relative to the generated root)

setQuery()

setQuery(string  $query) : void

Sets the query.

Parameters

string $query

Free-form string with writer-specific values.

getQuery()

getQuery() : string

Returns the set query.

Returns

string

setWriter()

setWriter(string  $writer) : void

Sets the writer type and instantiates a writer.

Parameters

string $writer

Name of writer to instantiate.

setSource()

setSource(string  $source) : void

Sets the source / type which the writer will use to generate artifacts from.

Parameters

string $source

Free-form string with writer-specific meaning.

getSource()

getSource() : string

Returns the name of the source / type used in the transformation process.

Returns

string

getSourceAsPath()

getSourceAsPath() : string

Returns the source as a path instead of a regular value.

This method applies the following rules to the value of $source:

  1. if the template_path parameter is set and that combined with the source gives an existing file; return that.
  2. if the value exists as a file (either relative to the current working directory or absolute), do a realpath and return it.
  3. Otherwise prepend it with the phpDocumentor data folder, if that does not exist: throw an exception

Throws

\phpDocumentor\Transformer\Exception

if no valid file could be found.

Returns

string

setArtifact()

setArtifact(string  $artifact) : void

Filename of the resulting artifact relative to the root.

If the query results in a set of artifacts (multiple nodes / array); then this string must contain an identifying variable as returned by the writer.

Parameters

string $artifact

Name of artifact to generate; usually a filepath.

getArtifact()

getArtifact() : string

Returns the name of the artifact.

Returns

string

setParameters()

setParameters(array<mixed,\phpDocumentor\Transformer\Template\Parameter>  $parameters) : void

Sets an array of parameters (key => value).

Parameters

array<mixed,\phpDocumentor\Transformer\Template\Parameter> $parameters

Associative multidimensional array containing parameters for the Writer.

getParameter()

getParameter(string  $name) : \phpDocumentor\Transformer\Template\Parameter

Returns a specific parameter, or $default if none exists.

Parameters

string $name

Name of the parameter to return.

Returns

\phpDocumentor\Transformer\Template\Parameter

getParametersWithKey()

getParametersWithKey(string  $name) : \phpDocumentor\Transformer\Template\Parameter

Returns a specific parameter, or $default if none exists.

Parameters

string $name

Name of the parameter to return.

Returns

\phpDocumentor\Transformer\Template\Parameter

setTransformer()

setTransformer(\phpDocumentor\Transformer\Transformer  $transformer) 

Sets the transformer on this transformation.

Parameters

\phpDocumentor\Transformer\Transformer $transformer