Template
in package
implements
ArrayAccess, Countable, IteratorAggregate
Model representing a template.
Tags
Interfaces, Classes and Traits
- ArrayAccess
- Countable
- IteratorAggregate
Table of Contents
- $author : string
- $copyright : string
- $description : string
- $files : MountManager
- $name : string
- $parameters : array<string|int, Parameter>
- $transformations : array<string|int, Transformation>
- $version : string
- __construct() : mixed
- Initializes this object with a name and optionally with contents.
- count() : int
- Count the number of transformations.
- files() : MountManager
- FlySystem filesystem / MountManager containing the template files, base templates files and destination filesystem.
- getAuthor() : string
- Returns the name and/or mail address of the author.
- getCopyright() : string
- Returns the copyright string for this template.
- getDescription() : string
- Returns the description for this template.
- getIterator() : ArrayIterator<int|string, Transformation>
- getName() : string
- Name for this template.
- getParameters() : array<string|int, Parameter>
- Returns the parameters associated with this template.
- getVersion() : string
- Returns the version number for this template.
- offsetExists() : bool
- Whether a offset exists.
- offsetGet() : Transformation
- Gets the transformation at the given offset.
- offsetSet() : void
- Sets a transformation at the given offset.
- offsetUnset() : void
- Offset to unset.
- propagateParameters() : void
- Pushes the parameters of this template into the transformations.
- setAuthor() : void
- The name of the author of this template (optionally including mail address).
- setCopyright() : void
- Sets the copyright string for this template.
- setDescription() : void
- Sets the description for this template.
- setParameter() : void
- Sets a new parameter in the collection.
- setVersion() : void
- Sets the version number for this template.
Properties
$author
private
string
$author
= ''
The name and optionally mail address of the author, i.e. Mike van Riel <me@mikevanriel.com>
.
$copyright
private
string
$copyright
= ''
A free-form copyright notice.
$description
private
string
$description
= ''
a text providing more information on this template.
$files
private
MountManager
$files
$name
private
string
$name
Name for this template
$parameters
private
array<string|int, Parameter>
$parameters
= []
Global parameters that are passed to each transformation.
$transformations
private
array<string|int, Transformation>
$transformations
= []
A series of transformations to execute in sequence during transformation.
$version
private
string
$version
= ''
The version of the template according to semantic versioning, i.e. 1.2.0
Methods
__construct()
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
Return values
mixed —count()
Count the number of transformations.
public
count() : int
Tags
Return values
int —The count as an integer.
files()
FlySystem filesystem / MountManager containing the template files, base templates files and destination filesystem.
public
files() : 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.
Return values
MountManager —getAuthor()
Returns the name and/or mail address of the author.
public
getAuthor() : string
Return values
string —getCopyright()
Returns the copyright string for this template.
public
getCopyright() : string
Return values
string —getDescription()
Returns the description for this template.
public
getDescription() : string
Return values
string —getIterator()
public
getIterator() : ArrayIterator<int|string, Transformation>
Return values
ArrayIterator<int|string, Transformation> —getName()
Name for this template.
public
getName() : string
Return values
string —getParameters()
Returns the parameters associated with this template.
public
getParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter> —getVersion()
Returns the version number for this template.
public
getVersion() : string
Return values
string —offsetExists()
Whether a offset exists.
public
offsetExists(int|string $offset) : bool
Parameters
- $offset : int|string
-
An offset to check for.
Tags
Return values
bool —Returns true on success or false on failure.
offsetGet()
Gets the transformation at the given offset.
public
offsetGet(int|string $offset) : Transformation
Parameters
- $offset : int|string
-
The offset to retrieve from.
Return values
Transformation —offsetSet()
Sets a transformation at the given offset.
public
offsetSet(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.
Tags
Return values
void —offsetUnset()
Offset to unset.
public
offsetUnset(int|string $offset) : void
Parameters
- $offset : int|string
-
Index of item to unset.
Tags
Return values
void —propagateParameters()
Pushes the parameters of this template into the transformations.
public
propagateParameters() : void
Return values
void —setAuthor()
The name of the author of this template (optionally including mail address).
public
setAuthor(string $author) : void
Parameters
- $author : string
-
Name of the author optionally including mail address between angle brackets.
Return values
void —setCopyright()
Sets the copyright string for this template.
public
setCopyright(string $copyright) : void
Parameters
- $copyright : string
-
Free-form copyright notice.
Return values
void —setDescription()
Sets the description for this template.
public
setDescription(string $description) : void
Parameters
- $description : string
-
An unconstrained text field where the user can provide additional information regarding details of the template.
Return values
void —setParameter()
Sets a new parameter in the collection.
public
setParameter(string|int $key, Parameter $value) : void
Parameters
- $key : string|int
- $value : Parameter
Return values
void —setVersion()
Sets the version number for this template.
public
setVersion(string $version) : void
Parameters
- $version : string
-
Semantic version number in this format: 1.0.0