PHP Class SassLiteral

Base class for all Sass literals. Sass data types are extended from this class.
Afficher le fichier Open project: richthegeek/phpsass Class Usage Examples

Méthodes publiques

Свойство Type Description
$typeOf maps class names to data types
$value value of the literal type

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

class constructor
public __construct ( string $value = null, $context ) : SassLiteral
$value string value of the literal type
Résultat SassLiteral

__get() public méthode

Getter.
public __get ( string $name ) : mixed
$name string name of property to get
Résultat mixed return value of getter function

__toString() public méthode

public __toString ( )

addChild() public méthode

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

assertInRange() public static méthode

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() public static méthode

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

getChildren() public méthode

public getChildren ( )

getTypeOf() public méthode

Returns the type of this
public getTypeOf ( ) : string
Résultat string the type of this

getValue() public méthode

Returns the value of this
public getValue ( ) : mixed
Résultat mixed the value of this

isa() public static méthode

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
Résultat mixed match at the start of the string or false if no match

op_and() public méthode

The SassScript and operation.
public op_and ( sassLiteral $other ) : SassLiteral
$other sassLiteral the value to and with this
Résultat SassLiteral other if this is boolean true, this if false

op_assign() public méthode

public op_assign ( $other )

op_bw_and() public méthode

Bitwise AND the value of other and this value
public op_bw_and ( string $other ) : string
$other string value to bitwise AND with
Résultat string result

op_bw_not() public méthode

Bitwise NOT the value of other and the value of this
public op_bw_not ( ) : string
Résultat string result

op_bw_or() public méthode

Bitwise OR the value of other and this value
public op_bw_or ( SassNumber $other ) : string
$other SassNumber value to bitwise OR with
Résultat string result

op_bw_xor() public méthode

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
Résultat string result

op_comma() public méthode

SassScript ',' operation.
public op_comma ( sassLiteral $other ) : sassString
$other sassLiteral the value to concatenate with a comma to this
Résultat sassString the string values of this and other seperated by ","

op_concat() public méthode

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
Résultat sassString the string values of this and other seperated by " "

op_div() public méthode

SassScript '/' operation.
public op_div ( SassLiteral $other ) : sassString
$other SassLiteral value to divide by
Résultat sassString the string values of this and other seperated by '/'

op_eq() public méthode

The SassScript == operation.
public op_eq ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Résultat SassBoolean SassBoolean object with the value true if this and other are equal, false if they are not

op_gt() public méthode

The SassScript > operation.
public op_gt ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Résultat 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() public méthode

The SassScript >= operation.
public op_gte ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Résultat 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() public méthode

The SassScript < operation.
public op_lt ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Résultat 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() public méthode

The SassScript <= operation.
public op_lte ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Résultat 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() public méthode

SassScript '-' operation.
public op_minus ( SassLiteral $other ) : sassString
$other SassLiteral value to subtract
Résultat sassString the string values of this and other seperated by '-'

op_modulo() public méthode

SassScript '%' operation.
public op_modulo ( SassLiteral $other ) : SassLiteral
$other SassLiteral value to take the modulus of
Résultat SassLiteral result

op_neq() public méthode

The SassScript != operation.
public op_neq ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to compare to this
Résultat SassBoolean SassBoolean object with the value true if this and other are not equal, false if they are

op_not() public méthode

The SassScript not operation.
public op_not ( ) : SassBoolean
Résultat SassBoolean SassBoolean object with the value true if the boolean of this is false or false if it is true

op_or() public méthode

The SassScript or operation.
public op_or ( sassLiteral $other ) : SassLiteral
$other sassLiteral the value to or with this
Résultat SassLiteral this if this is boolean true, other if false

op_plus() public méthode

SassScript '+' operation.
public op_plus ( sassLiteral $other ) : sassString
$other sassLiteral value to add
Résultat sassString the string values of this and other with no seperation

op_shiftl() public méthode

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
Résultat string result

op_shiftr() public méthode

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
Résultat string result

op_times() public méthode

SassScript '*' operation.
public op_times ( SassLiteral $other ) : sassString
$other SassLiteral value to multiply by
Résultat sassString the string values of this and other seperated by '*'

op_xor() public méthode

The SassScript xor operation.
public op_xor ( sassLiteral $other ) : SassBoolean
$other sassLiteral the value to xor with this
Résultat SassBoolean SassBoolean object with the value true if this or other, but not both, are true, false if not

render() public méthode

public render ( )

toBoolean() public méthode

Returns the boolean representation of the value of this
public toBoolean ( ) : boolean
Résultat boolean the boolean representation of the value of this

toString() abstract public méthode

Returns a string representation of the value.
abstract public toString ( ) : string
Résultat string string representation of the value.

Property Details

$typeOf public_oe static_oe property

maps class names to data types
public static $typeOf

$value public_oe property

value of the literal type
public $value