Template
in package
implements
ArrayAccess, Countable, IteratorAggregate
Model representing a template.
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $author : string
- $copyright : string
- $description : string
- $extends : string|null
- $files : MountManager
- $name : string
- $parameters : array<string|int, Parameter>
- $transformations : array<string|int, Transformation>
- $version : string
Methods
- __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.
- getExtends() : string|null
- 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.
- merge() : void
- 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.
- setExtends() : void
- 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 <[email protected]>
.
$copyright
private
string
$copyright
= ''
A free-form copyright notice.
$description
private
string
$description
= ''
a text providing more information on this template.
$extends
private
string|null
$extends
= null
$files read-only
private
MountManager
$files
$name read-only
private
string
$name
$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
count()
Count the number of transformations.
public
count() : int
Tags
Attributes
- #[ReturnTypeWillChange]
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
MountManagergetAuthor()
Returns the name and/or mail address of the author.
public
getAuthor() : string
Return values
stringgetCopyright()
Returns the copyright string for this template.
public
getCopyright() : string
Return values
stringgetDescription()
Returns the description for this template.
public
getDescription() : string
Return values
stringgetExtends()
public
getExtends() : string|null
Return values
string|nullgetIterator()
public
getIterator() : ArrayIterator<int|string, Transformation>
Attributes
- #[ReturnTypeWillChange]
Return values
ArrayIterator<int|string, Transformation>getName()
Name for this template.
public
getName() : string
Return values
stringgetParameters()
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
stringmerge()
public
merge(Template $parentTemplate) : void
Parameters
- $parentTemplate : Template
offsetExists()
Whether a offset exists.
public
offsetExists(int|string $offset) : bool
Parameters
- $offset : int|string
-
An offset to check for.
Tags
Attributes
- #[ReturnTypeWillChange]
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.
Attributes
- #[ReturnTypeWillChange]
Return values
TransformationoffsetSet()
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
Attributes
- #[ReturnTypeWillChange]
offsetUnset()
Offset to unset.
public
offsetUnset(int|string $offset) : void
Parameters
- $offset : int|string
-
Index of item to unset.
Tags
Attributes
- #[ReturnTypeWillChange]
propagateParameters()
Pushes the parameters of this template into the transformations.
public
propagateParameters() : 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.
setCopyright()
Sets the copyright string for this template.
public
setCopyright(string $copyright) : void
Parameters
- $copyright : string
-
Free-form copyright notice.
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.
setExtends()
public
setExtends(string|null $template) : void
Parameters
- $template : string|null
setParameter()
Sets a new parameter in the collection.
public
setParameter(string|int $key, Parameter $value) : void
Parameters
- $key : string|int
- $value : Parameter
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