Template

in package
Implements ArrayAccess, Countable, IteratorAggregate

Model representing a template.

Interfaces, Classes & Used Traits

ArrayAccess
Countable
IteratorAggregate
template-implements

ArrayAccess<int|string, Transformation>

template-implements

IteratorAggregate<int|string, Transformation>

Properties

private$name  : string                

private$author  : string                

private$version  : string                

private$description  : string                

private$transformations  : \phpDocumentor\Transformer\Transformation[]                

private$parameters  : \phpDocumentor\Transformer\Template\Parameter[]                

private$files  : \League\Flysystem\MountManager                

Methods

Initializes this object with a name and optionally with contents.

public__construct(string $name, MountManager $files) : mixed

Parameters

$name : string

Name for this template.

$files : MountManager

Returns

mixed

Name for this template.

publicgetName() : string

Returns

string

The name of the author of this template (optionally including mail address).

publicsetAuthor(string $author) : void

Parameters

$author : string

Name of the author optionally including mail address between angle brackets.

Returns the name and/or mail address of the author.

publicgetAuthor() : string

Returns

string

Sets the copyright string for this template.

publicsetCopyright(string $copyright) : void

Parameters

$copyright : string

Free-form copyright notice.

Returns the copyright string for this template.

publicgetCopyright() : string

Returns

string

Sets the version number for this template.

publicsetVersion(string $version) : void

Parameters

$version : string

Semantic version number in this format: 1.0.0

Throws

\InvalidArgumentException

If the version number is invalid.

FlySystem filesystem / MountManager containing the template files, base templates files and destination filesystem.

publicfiles() : MountManager

This MountManager has three mounts:

  • template://, the files of this template
  • templates://, the base folder containing phpDocumentor's global templates (i.e. /data/templates)
  • destination://, the destination where the template needs to write to

By combining this in one mount manager it is easier for writers to copy files between destinations (since MountManager's can copy between filesystems) and for writers to read and write from various locations.

Returns

MountManager

Returns the version number for this template.

publicgetVersion() : string

Returns

string

Sets the description for this template.

publicsetDescription(string $description) : void

Parameters

$description : string

An unconstrained text field where the user can provide additional information regarding details of the template.

Returns the description for this template.

publicgetDescription() : string

Returns

string

Sets a transformation at the given offset.

publicoffsetSet(int|string $offset, Transformation $value) : void

Parameters

$offset : int|string

The offset to place the value at.

$value : Transformation

The transformation to add to this template.

Throws

\InvalidArgumentException

If an invalid item was received.

Gets the transformation at the given offset.

publicoffsetGet(int|string $offset) : Transformation

Parameters

$offset : int|string

The offset to retrieve from.

Returns

Transformation

Offset to unset.

publicoffsetUnset(int|string $offset) : void

Parameters

$offset : int|string

Index of item to unset.

Whether a offset exists.

publicoffsetExists(mixed $offset) : bool

Parameters

$offset : mixed

An offset to check for.

Returns

bool

Returns true on success or false on failure.

Count the number of transformations.

publiccount() : int

Returns

int

The count as an integer.

Returns the parameters associated with this template.

publicgetParameters() : \phpDocumentor\Transformer\Template\Parameter[]

Returns

\phpDocumentor\Transformer\Template\Parameter[]

Sets a new parameter in the collection.

publicsetParameter(string|int $key, Parameter $value) : void

Parameters

$key : string|int
$value : Parameter

Pushes the parameters of this template into the transformations.

publicpropagateParameters() : void

publicgetIterator() : \ArrayIterator

Returns

\ArrayIterator