Transformation

Class representing a single Transformation.

package

Default

Methods

Constructs a new Transformation object and populates the required parameters.

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

Arguments

$query

string

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

$writer

string

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

$source

string

Which template or type of source to use.

$artifact

string

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

Returns the name of the artifact.

getArtifact() : string

Response

string

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

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

Arguments

$name

string

Name of the parameter to return.

Response

\phpDocumentor\Transformer\Template\Parameter

Returns all parameters for this transformation.

getParameters() : array<mixed,\phpDocumentor\Transformer\Template\Parameter>

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

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

Arguments

$name

string

Name of the parameter to return.

Response

\phpDocumentor\Transformer\Template\Parameter

Returns the set query.

getQuery() : string

Response

string

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

getSource() : string

Response

string

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

getSourceAsPath() : string

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.

Response

string

Returns the transformer for this transformation.

getTransformer() : \phpDocumentor\Transformer\Transformer

Returns an instantiated writer object.

getWriter() : \phpDocumentor\Transformer\Writer\WriterAbstract|null

Filename of the resulting artifact relative to the root.

setArtifact(string $artifact) : void

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.

Arguments

$artifact

string

Name of artifact to generate; usually a filepath.

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

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

Arguments

$parameters

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

Associative multidimensional array containing parameters for the Writer.

Sets the query.

setQuery(string $query) : void

Arguments

$query

string

Free-form string with writer-specific values.

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

setSource(string $source) : void

Arguments

$source

string

Free-form string with writer-specific meaning.

Sets the transformer on this transformation.

setTransformer(\phpDocumentor\Transformer\Transformer $transformer) 

Sets the writer type and instantiates a writer.

setWriter(string $writer) : void

Arguments

$writer

string

Name of writer to instantiate.

Properties

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

writer : string
Serializer\XmlAttribute
Serializer\Type

("string")

var

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

Type(s)

string

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

artifact : string
Serializer\XmlAttribute
Serializer\Type

("string")

var

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

Type(s)

string

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

source : string
Serializer\XmlAttribute
Serializer\Type

("string")

var

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

Type(s)

string

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

query : string
Serializer\XmlAttribute
Serializer\Type

("string")

var

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

Type(s)

string

The object guiding the transformation process and having meta-data of it.

transformer : \phpDocumentor\Transformer\Transformer
Serializer\Exclude
var

The object guiding the transformation process and having meta-data of it.

Type(s)

\phpDocumentor\Transformer\Transformer

A series of parameters that can influence what the writer does; the exact function differs per writer.

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

(entry = "parameter")

Serializer\Type

("array<phpDocumentor\Transformer\Template\Parameter>")

var

A series of parameters that can influence what the writer does; the exact function differs per writer.

Type(s)

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