BlockToken
extends AbstractToken
in package
Tags
Table of Contents
Properties
- $data : mixed
- $parent : BlockToken|null
- $previousToken : Token|null
Methods
- __construct() : mixed
- Constructs a BlockToken.
- addToken() : void
- calculateEndPosition() : Position
- calculateStartPosition() : Position
- getBlockCurrentToken() : Token|null
- Get the current token of a given class.
- getEnd() : Position|null
- getParent() : BlockToken|null
- getPreviousToken() : Token|null
- getStart() : Position
- getType() : string
- getValue() : TValue
- isComplete() : bool
- jsonSerialize() : SerializedToken
- Returns a JSON serializable representation of the token.
- setEnd() : self
- setParent() : self
- setPreviousToken() : self
Properties
$data
protected
mixed
$data
$parent
protected
BlockToken|null
$parent
= null
$previousToken
protected
Token|null
$previousToken
= null
Methods
__construct()
Constructs a BlockToken.
public
__construct(array<string|int, Token> $value, Position $start[, Position|null $end = null ]) : mixed
Parameters
addToken()
public
addToken(Token $token) : void
Parameters
- $token : Token
calculateEndPosition()
public
static calculateEndPosition(TokenizerContext $tokenizerContext[, Token|null $token = null ]) : Position
Parameters
- $tokenizerContext : TokenizerContext
- $token : Token|null = null
Return values
PositioncalculateStartPosition()
public
static calculateStartPosition(TokenizerContext $tokenizerContext) : Position
Parameters
- $tokenizerContext : TokenizerContext
Return values
PositiongetBlockCurrentToken()
Get the current token of a given class.
public
getBlockCurrentToken() : Token|null
Return values
Token|null —The current token of the given class, or null if not found.
getEnd()
public
getEnd() : Position|null
Return values
Position|nullgetParent()
public
getParent() : BlockToken|null
Return values
BlockToken|nullgetPreviousToken()
public
getPreviousToken() : Token|null
Return values
Token|nullgetStart()
public
getStart() : Position
Return values
PositiongetType()
public
getType() : string
Return values
stringgetValue()
public
getValue() : TValue
Return values
TValueisComplete()
public
isComplete() : bool
Return values
booljsonSerialize()
Returns a JSON serializable representation of the token.
public
jsonSerialize() : SerializedToken
Return values
SerializedTokensetEnd()
public
setEnd(Position $end) : self
Parameters
- $end : Position
Return values
selfsetParent()
public
setParent(BlockToken|null $parent) : self
Parameters
- $parent : BlockToken|null
Return values
selfsetPreviousToken()
public
setPreviousToken(Token|null $previousToken) : self
Parameters
- $previousToken : Token|null