Documentation

Template
in package

Table of Contents

REGEXP_EXPRESSION_DETECTOR  = '/\{[^\}]*\}/x'
Expression regular expression pattern.
$expressions  : array<string|int, mixed>
$template  : string
$variableNames  : array<string|int, mixed>
__set_state()  : self
{@inheritDoc}
createFromString()  : self
expand()  : string
toString()  : string
variableNames()  : array<string|int, string>
__construct()  : mixed

Constants

REGEXP_EXPRESSION_DETECTOR

Expression regular expression pattern.

private mixed REGEXP_EXPRESSION_DETECTOR = '/\{[^\}]*\}/x'

Properties

$expressions

private array<string|int, mixed> $expressions = []

$variableNames

private array<string|int, mixed> $variableNames

Methods

__set_state()

{@inheritDoc}

public static __set_state(array<string|int, mixed> $properties) : self
Parameters
$properties : array<string|int, mixed>
Return values
self

createFromString()

public static createFromString(object|string $template) : self
Parameters
$template : object|string

a string or an object with the __toString method

Tags
throws
TypeError

if the template is not a string or an object with the __toString method

throws
SyntaxError

if the template contains invalid expressions

throws
SyntaxError

if the template contains invalid variable specification

Return values
self

toString()

public toString() : string
Return values
string

variableNames()

public variableNames() : array<string|int, string>
Return values
array<string|int, string>

__construct()

private __construct(string $template, Expression ...$expressions) : mixed
Parameters
$template : string
$expressions : Expression
Return values
mixed

Search results