ConstantAwareTokenStream

final class \TYPO3\CMS\Core\TypoScript\Tokenizer\Token\ConstantAwareTokenStream

Extends
AbstractTokenStream

A list of single T_VALUE, T_NEWLINE and T_CONSTANT tokens. This is only created for LineIdentifierAssignment lines if there is at least one T_CONSTANT token in the assignment that needs to be evaluated when string'ified by the AST-builder.

Tags

internal:

Internal tokenizer structure.

Table of Contents

Properties

$currentIndex  : int
$tokens  : TokenInterface[]

Methods

__serialize()  : array
When storing to cache, we only store FE relevant properties and skip irrelevant things. For instance $currentIndex should always initialize to -1 and does not need to be stored.
__toString()  : string
Create a source string from given tokens.
append()  : self
Stream creation.
getAll()  : TokenInterface[]
Only used internally when one Stream is transferred to another, in particular when a TokenStream is turned into TokenStreamConstantAware.
getNext()  : TokenInterface|null
Get next token and raise pointer.
isEmpty()  : bool
We sometimes create a stream but don't add tokens.
peekNext()  : TokenInterface|null
Get next token but do not raise pointer.
reset()  : static
Reset current pointer. Typically, call this before iterating with getNext().
setAll()  : self
Only used internally when one Stream is transferred to another, in particular when a TokenStream is turned into TokenStreamConstantAware.
setFlatConstants()  : void
Set by the AstBuilder to resolve constant values. Never cached.
serialize()  : array

Properties

$currentIndex

protected int $currentIndex = -1

Methods

__serialize()

When storing to cache, we only store FE relevant properties and skip irrelevant things. For instance $currentIndex should always initialize to -1 and does not need to be stored.

public final __serialize() : array

Return values

array

__toString()

Create a source string from given tokens.

public __toString() : string

This resolves T_CONSTANT tokens to their value if they exist in $this->flatConstants.

Return values

string

getAll()

Only used internally when one Stream is transferred to another, in particular when a TokenStream is turned into TokenStreamConstantAware.

public getAll() : TokenInterface[]

Return values

TokenInterface[]

isEmpty()

We sometimes create a stream but don't add tokens.

public isEmpty() : bool

This method returns true if tokens have been added.

Return values

bool

reset()

Reset current pointer. Typically, call this before iterating with getNext().

public reset() : static

Return values

static

setAll()

Only used internally when one Stream is transferred to another, in particular when a TokenStream is turned into TokenStreamConstantAware.

public setAll(array $tokens) : self

Parameters

$tokens : array

Return values

self

setFlatConstants()

Set by the AstBuilder to resolve constant values. Never cached.

public setFlatConstants(array $flatConstants) : void

Parameters

$flatConstants : array

serialize()

protected serialize() : array

Return values

array
On this page