phpDocumentor

Template
in package
implements ArrayAccess, Countable, IteratorAggregate

Model representing a template.

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

private string $copyright = ''

$description

private string $description = ''

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

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

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

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
throws
InvalidArgumentException

If an invalid item was received.

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

Tags
throws
InvalidArgumentException

If the version number is invalid.

Return values
void

Search results