Core class responsible for transforming the structure.xml file to a set of artifacts.

category phpDocumentor
package Transformer
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Sets the path for the templates to the phpDocumentor default.

__construct() 

Loads a template by name, if an additional array with details is provided it will try to load parameters from it.

addTemplate(string $name) : void

Parameters

$name

string

Name of the template to add.

Copies a file or folder recursively to another location.

copyRecursive(string $src, string $dst) : void

Parameters

$src

string

The source location to copy

$dst

string

The destination location to copy to

Exceptions

\Exception if $src does not exist or $dst is not writable

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited

inherited_from \phpDocumentor_Transformer_Abstract::debug()

Parameters

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

dispatch(string $name, \string[] $arguments) : mixed | null
Inherited

This method tries to dispatch an event; if no Event Dispatcher has been set than this method will explicitly not fail and return null. By not failing we make the Event Dispatcher optional and is it easier for people to re-use this component in their own application.

inherited_from \phpDocumentor_Transformer_Abstract::dispatch()

Parameters

$name

string

Name of the event to dispatch.

$arguments

\string[]

Arguments for this event.

Exceptions

\phpDocumentor_Parser_Exception if there is a dispatcher but it is not of type sfEventDispatcher

Returns

mixednull

Executes each transformation.

execute() : void

Returns the url for this class if it is registered.

findExternalClassDocumentLocation(string $class) : null | string

Parameters

$class

string

FQCN to retrieve documentation URL for.

Returns

nullstring

Converts a source file name to the name used for generating the end result.

generateFilename(string $name) : string

This method strips down the given $name using the following rules: * if the $name is postfixed with .php then that is removed * any occurance of \ or DIRECTORY_SEPARATOR is replaced with . * any dots that the name starts or ends with is removed * the result is postfixed with .html

Parameters

$name

string

Name to convert.

Returns

string

Returns the registered prefix -> url pairs.

getExternalClassDocs() : \string[]

Returns

\string[]

Retrieves the url for a given prefix.

getExternalClassDocumentLocation(string $prefix, string $class) : string | null

Parameters

$prefix

string

Class prefix to retrieve a URL for.

$class

string

If provided will replace the {CLASS} param with this string.

Returns

stringnull

Returns flag indicating whether private members and/or elements tagged as {@internal} need to be displayed.

getParseprivate() : bool

Returns

bool

Returns the source Structure.

getSource() : null | \DOMDocument

Returns

Returns the location where to store the artifacts.

getTarget() : string

Returns

string

Returns the list of templates which are going to be adopted.

getTemplates() : \string[]

Returns

\string[]

Returns the path where the templates are located.

getTemplatesPath() : string

Returns

string

Returns the transformation which this transformer will process.

getTransformations() : \phpDocumentor_Transformer_Transformation[]

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited

inherited_from \phpDocumentor_Transformer_Abstract::log()

Parameters

$message

string

The message to log.

$priority

int

The logging priority, the lower, the more important. Ranges from 1 to 7

Adds a link to external documentation.

setExternalClassDoc(string $prefix, string $uri) : void

Please note that the prefix string is matched against the start of the class name and that the preceding \ for namespaces should NOT be included. You can augment the URI with the name of the found class by inserting the param {CLASS}. By default the class is inserted as-is; to insert a lowercase variant use the parameter {LOWERCASE_CLASS}

Parameters

$prefix

string

Class prefix to match, i.e. Zend_Config_

$uri

string

URI to link to when above prefix is encountered.

Sets a set of prefix -> url parts.

setExternalClassDocs(\string[] $external_class_docs) : void

see \self::setExternalClassDoc()

Parameters

$external_class_docs

\string[]

Array containing prefix => URI pairs.

Sets flag indicating whether private members and/or elements tagged as {@internal} need to be displayed.

setParseprivate(bool $val) : void

Parameters

$val

bool

True if all needs to be shown, false otherwise.

Sets the location of the structure file.

setSource(string $source) : void

Parameters

$source

string

The location of the structure file as full path (may be relative).

Exceptions

\Exception if the source is not a valid readable file.

Sets the target location where to output the artifacts.

setTarget(string $target) : void

Parameters

$target

string

The target location where to output the artifacts.

Exceptions

\Exception if the target is not a valid writable directory.

Sets one or more templates as basis for the transformations.

setTemplates(string | \string[] $template) : void

Parameters

$template

string\string[]

Name or names of the templates.

Sets the path where the templates are located.

setTemplatesPath(string $path) : void

Parameters

$path

string

Absolute path where the templates are.

 Properties

 

The event dispatcher object, may be null to not dispatch events.

$event_dispatcher : \sfEventDispatcher | null
Inherited

inherited_from \phpDocumentor_Transformer_Abstract::$$event_dispatcher
 

$behaviours

$behaviours : \phpDocumentor_Transformer_Behaviour_Collection

 

Array containing prefix => URL values.

$external_class_docs : string

What happens is that the transformer knows where to find external API docs for classes with a certain prefix. For example: having a prefix HTML_QuickForm2_ will link an unidentified class that starts with HTML_QuickForm2_ to a (defined) URL i.e. http://pear.php.net/package/HTML_QuickForm2/docs/ latest/HTML_QuickForm2/${class}.html

 

$parsePrivate

$parsePrivate : boolean

 

<p>DOM of the structure as generated by the parser.</p>

$source : \DOMDocument | null

 

<p>Target location where to output the artifacts</p>

$target : string | null

 

$templates

$templates : \phpDocumentor_Transformer_Template[]

 

$templates_path

$templates_path : string

 

$transformations

$transformations : \phpDocumentor_Transformer_Transformation[]