Documentation

TokenizerContext
in package

Tags
phpstan-type

Errors array<array-key, LintError>

Table of Contents

Properties

$currentBlockToken  : BlockToken|null
Current block token being processed
$currentContent  : string
Current content of parse. Ex: the selector name, the property name or the property content
$currentPosition  : Position|null
Current position of the tokenizer
$currentToken  : Token|null
Current token being processed
$previousToken  : Token|null
Previous token being processed

Methods

appendCurrentContent()  : self
Append new value to context content
assertCurrentToken()  : bool
Assert that current token is the same type as given token
currentContentEndsWith()  : bool
getCurrentBlockToken()  : BlockToken|null
getCurrentContent()  : string
Return context content
getCurrentPosition()  : Position
getCurrentToken()  : Token|null
Get the current token being processed
getLastChar()  : string|null
Get the last char of the current content
getNthLastChars()  : string|null
Get the nth last char of the current content
getPreviousToken()  : Token|null
incrementColumn()  : self
incrementLine()  : self
resetCurrentContent()  : self
Reset current content property
resetCurrentToken()  : self
Reset current token property
setCurrentBlockToken()  : self
setCurrentToken()  : self
Set new current token

Properties

$currentContent

Current content of parse. Ex: the selector name, the property name or the property content

private string $currentContent = ''

Methods

appendCurrentContent()

Append new value to context content

public appendCurrentContent(string $currentContent) : self
Parameters
$currentContent : string
Return values
self

assertCurrentToken()

Assert that current token is the same type as given token

public assertCurrentToken(Token>|null $token) : bool
Parameters
$token : Token>|null
Tags
phpstan-assert-if-true

Token $this->currentToken

Return values
bool

currentContentEndsWith()

public currentContentEndsWith(string $string) : bool
Parameters
$string : string
Return values
bool

getCurrentContent()

Return context content

public getCurrentContent() : string
Return values
string

getLastChar()

Get the last char of the current content

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

getNthLastChars()

Get the nth last char of the current content

public getNthLastChars(int<1, max> $length[, int<0, max> $offset = 0 ]) : string|null
Parameters
$length : int<1, max>
$offset : int<0, max> = 0
Return values
string|null

resetCurrentContent()

Reset current content property

public resetCurrentContent() : self
Return values
self

resetCurrentToken()

Reset current token property

public resetCurrentToken() : self
Return values
self

setCurrentToken()

Set new current token

public setCurrentToken(Token|null $currentToken) : self
Parameters
$currentToken : Token|null
Return values
self

        
On this page

Search results