PHP Class PhpCss\Scanner\Token

Show file Open project: ThomasWeinert/PhpCss Class Usage Examples

Public Methods

Method Description
__construct ( integer $type, string $content = '', integer $position ) : Token Construct and initialize token
__get ( string $name ) : integer | string Get token attribute
__set ( string $name, mixed $value ) : void Do not allow to set attributes
__toString ( ) : string Convert token object to string
typeToString ( integer $type ) : string Return string representation of token type

Protected Methods

Method Description
quoteContent ( string $content ) : string Escape content for double quoted, single line string representation

Method Details

__construct() public method

Construct and initialize token
public __construct ( integer $type, string $content = '', integer $position ) : Token
$type integer
$content string
$position integer
return Token

__get() public method

Get token attribute
public __get ( string $name ) : integer | string
$name string
return integer | string

__set() public method

Do not allow to set attributes
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
return void

__toString() public method

Convert token object to string
public __toString ( ) : string
return string

quoteContent() protected method

Escape content for double quoted, single line string representation
protected quoteContent ( string $content ) : string
$content string
return string

typeToString() public static method

Return string representation of token type
public static typeToString ( integer $type ) : string
$type integer
return string