PHP Класс SassLiteral

Base class for all Sass literals. Sass data types are extended from this class.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$typeOf maps class names to data types
$value value of the literal type

Открытые методы

Метод Описание
__construct ( string $value = null, $context ) : SassLiteral class constructor
__get ( string $name ) : mixed Getter.
__toString ( )
addChild ( sassLiteral $sassLiteral ) Adds a child object to this.
assertInRange ( SassLiteral $literal, float $min, float $max, string $units = '' ) Asserts that the value of a literal is within the expected range
assertType ( $literal, string $type ) Asserts that the literal is the expected type
getChildren ( )
getTypeOf ( ) : string Returns the type of this
getValue ( ) : mixed Returns the value of this
isa ( string $subject ) : mixed Returns a value indicating if a token of this type can be matched at the start of the subject string.
op_and ( sassLiteral $other ) : SassLiteral The SassScript and operation.
op_assign ( $other )
op_bw_and ( string $other ) : string Bitwise AND the value of other and this value
op_bw_not ( ) : string Bitwise NOT the value of other and the value of this
op_bw_or ( SassNumber $other ) : string Bitwise OR the value of other and this value
op_bw_xor ( SassNumber $other ) : string Bitwise XOR the value of other and the value of this
op_comma ( sassLiteral $other ) : sassString SassScript ',' operation.
op_concat ( sassLiteral $other ) : sassString The SassScript default operation (e.g. $a $b, "foo" "bar").
op_div ( SassLiteral $other ) : sassString SassScript '/' operation.
op_eq ( sassLiteral $other ) : SassBoolean The SassScript == operation.
op_gt ( sassLiteral $other ) : SassBoolean The SassScript > operation.
op_gte ( sassLiteral $other ) : SassBoolean The SassScript >= operation.
op_lt ( sassLiteral $other ) : SassBoolean The SassScript < operation.
op_lte ( sassLiteral $other ) : SassBoolean The SassScript <= operation.
op_minus ( SassLiteral $other ) : sassString SassScript '-' operation.
op_modulo ( SassLiteral $other ) : SassLiteral SassScript '%' operation.
op_neq ( sassLiteral $other ) : SassBoolean The SassScript != operation.
op_not ( ) : SassBoolean The SassScript not operation.
op_or ( sassLiteral $other ) : SassLiteral The SassScript or operation.
op_plus ( sassLiteral $other ) : sassString SassScript '+' operation.
op_shiftl ( SassNumber $other ) : string Shifts the value of this left by the number of bits given in value
op_shiftr ( SassNumber $other ) : string Shifts the value of this right by the number of bits given in value
op_times ( SassLiteral $other ) : sassString SassScript '*' operation.
op_xor ( sassLiteral $other ) : SassBoolean The SassScript xor operation.
render ( )
toBoolean ( ) : boolean Returns the boolean representation of the value of this
toString ( ) : string Returns a string representation of the value.

Описание методов

__construct() публичный Метод

class constructor
public __construct ( string $value = null, $context ) : SassLiteral
$value string value of the literal type
Результат SassLiteral

__get() публичный Метод

Getter.
public __get ( string $name ) : mixed
$name string name of property to get
Результат mixed return value of getter function

__toString() публичный Метод

public __toString ( )

addChild() публичный Метод

Adds a child object to this.
public addChild ( sassLiteral $sassLiteral )
$sassLiteral sassLiteral the child object

assertInRange() публичный статический Метод

Asserts that the value of a literal is within the expected range
public static assertInRange ( SassLiteral $literal, float $min, float $max, string $units = '' )
$literal SassLiteral the literal to test
$min float the minimum value
$max float the maximum value
$units string the units.

assertType() публичный статический Метод

Asserts that the literal is the expected type
public static assertType ( $literal, string $type )
$type string expected type

getChildren() публичный Метод

public getChildren ( )

getTypeOf() публичный Метод

Returns the type of this
public getTypeOf ( ) : string
Результат string the type of this

getValue() публичный Метод

Returns the value of this
public getValue ( ) : mixed
Результат mixed the value of this

isa() публичный статический Метод

Returns a value indicating if a token of this type can be matched at the start of the subject string.
public static isa ( string $subject ) : mixed
$subject string the subject string
Результат mixed match at the start of the string or false if no match

op_and() публичный Метод

The SassScript and operation.
public op_and ( sassLiteral $other ) : SassLiteral
$other sassLiteral the value to and with this
Результат SassLiteral other if this is boolean true, this if false

op_assign() публичный Метод

public op_assign ( $other )

op_bw_and() публичный Метод

Bitwise AND the value of other and this value
public op_bw_and ( string $other ) : string
$other string value to bitwise AND with
Результат string result

op_bw_not() публичный Метод

Bitwise NOT the value of other and the value of this
public op_bw_not ( ) : string
Результат string result

op_bw_or() публичный Метод

Bitwise OR the value of other and this value
public op_bw_or ( SassNumber $other ) : string
$other SassNumber value to bitwise OR with
Результат string result

op_bw_xor() публичный Метод

Bitwise XOR the value of other and the value of this
public op_bw_xor ( SassNumber $other ) : string
$other SassNumber value to bitwise XOR with
Результат string result

op_comma() публичный Метод

SassScript ',' operation.
public op_comma ( sassLiteral $other ) : sassString
$other sassLiteral the value to concatenate with a comma to this
Результат sassString the string values of this and other seperated by ","

op_concat() публичный Метод

The SassScript default operation (e.g. $a $b, "foo" "bar").
public op_concat ( sassLiteral $other ) : sassString
$other sassLiteral the value to concatenate with a space to this
Результат sassString the string values of this and other seperated by " "

op_div() публичный Метод

SassScript '/' operation.
public op_div ( SassLiteral $other ) : sassString
$other SassLiteral value to divide by
Результат sassString the string values of this and other seperated by '/'

op_eq() публичный Метод

The SassScript == operation.
public op_eq ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Результат SassBoolean SassBoolean object with the value true if this and other are equal, false if they are not

op_gt() публичный Метод

The SassScript > operation.
public op_gt ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Результат SassBoolean SassBoolean object with the value true if the values of this is greater than the value of other, false if it is not

op_gte() публичный Метод

The SassScript >= operation.
public op_gte ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Результат SassBoolean SassBoolean object with the value true if the values of this is greater than or equal to the value of other, false if it is not

op_lt() публичный Метод

The SassScript < operation.
public op_lt ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Результат SassBoolean SassBoolean object with the value true if the values of this is less than the value of other, false if it is not

op_lte() публичный Метод

The SassScript <= operation.
public op_lte ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Результат SassBoolean SassBoolean object with the value true if the values of this is less than or equal to the value of other, false if it is not

op_minus() публичный Метод

SassScript '-' operation.
public op_minus ( SassLiteral $other ) : sassString
$other SassLiteral value to subtract
Результат sassString the string values of this and other seperated by '-'

op_modulo() публичный Метод

SassScript '%' operation.
public op_modulo ( SassLiteral $other ) : SassLiteral
$other SassLiteral value to take the modulus of
Результат SassLiteral result

op_neq() публичный Метод

The SassScript != operation.
public op_neq ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Результат SassBoolean SassBoolean object with the value true if this and other are not equal, false if they are

op_not() публичный Метод

The SassScript not operation.
public op_not ( ) : SassBoolean
Результат SassBoolean SassBoolean object with the value true if the boolean of this is false or false if it is true

op_or() публичный Метод

The SassScript or operation.
public op_or ( sassLiteral $other ) : SassLiteral
$other sassLiteral the value to or with this
Результат SassLiteral this if this is boolean true, other if false

op_plus() публичный Метод

SassScript '+' operation.
public op_plus ( sassLiteral $other ) : sassString
$other sassLiteral value to add
Результат sassString the string values of this and other with no seperation

op_shiftl() публичный Метод

Shifts the value of this left by the number of bits given in value
public op_shiftl ( SassNumber $other ) : string
$other SassNumber amount to shift left by
Результат string result

op_shiftr() публичный Метод

Shifts the value of this right by the number of bits given in value
public op_shiftr ( SassNumber $other ) : string
$other SassNumber amount to shift right by
Результат string result

op_times() публичный Метод

SassScript '*' operation.
public op_times ( SassLiteral $other ) : sassString
$other SassLiteral value to multiply by
Результат sassString the string values of this and other seperated by '*'

op_xor() публичный Метод

The SassScript xor operation.
public op_xor ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to xor with this
Результат SassBoolean SassBoolean object with the value true if this or other, but not both, are true, false if not

render() публичный Метод

public render ( )

toBoolean() публичный Метод

Returns the boolean representation of the value of this
public toBoolean ( ) : boolean
Результат boolean the boolean representation of the value of this

toString() абстрактный публичный Метод

Returns a string representation of the value.
abstract public toString ( ) : string
Результат string string representation of the value.

Описание свойств

$typeOf публичное статическое свойство

maps class names to data types
public static $typeOf

$value публичное свойство

value of the literal type
public $value