phpDocumentor

Template implements ArrayAccess, Countable, IteratorAggregate

FinalYes

Model representing a template.

Table of Contents

Interfaces

ArrayAccess
Countable
IteratorAggregate

Properties

$author  : string
$copyright  : string
$description  : string
$extends  : string|null
$files  : FileSystem
$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()  : 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

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 FileSystem $files

$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, FileSystem $files) : mixed
Parameters
$name : string

Name for this template.

$files : FileSystem

files()

public files() : FileSystem
Return values
FileSystem

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

getExtends()

public getExtends() : string|null
Return values
string|null

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
link
https://www.php.net/arrayaccess.offsetexists
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
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.

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

Tags
throws
InvalidArgumentException

If the version number is invalid.


        
On this page

Search results