PHP Class Leafo\ScssPhp\Node\Number

{@internal This is a work-in-progress. The \ArrayAccess interface is temporary until the migration is complete.}}
Author: Anthon Pang ([email protected])
Inheritance: extends Leafo\ScssPhp\Node, implements ArrayAccess
Afficher le fichier Open project: leafo/scssphp Class Usage Examples

Méthodes publiques

Свойство Type Description
$dimension integer | float
$precision integer
$units array

Protected Properties

Свойство Type Description
$unitTable array

Méthodes publiques

Méthode Description
__construct ( mixed $dimension, mixed $initialUnit ) Initialize number
__toString ( )
coerce ( array $units ) : Number Coerce number to target units
normalize ( ) : Number Normalize number
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
output ( Compiler $compiler = null ) : string Output number
unitStr ( ) : string Returns unit(s) as the product of numerator units divided by the product of denominator units
unitless ( ) : boolean Returns true if the number is unitless

Private Methods

Méthode Description
normalizeUnits ( integer | float &$dimension, array &$units, string $baseUnit = 'in' ) Normalize units

Method Details

__construct() public méthode

Initialize number
public __construct ( mixed $dimension, mixed $initialUnit )
$dimension mixed
$initialUnit mixed

__toString() public méthode

public __toString ( )

coerce() public méthode

Coerce number to target units
public coerce ( array $units ) : Number
$units array
Résultat Number

normalize() public méthode

Normalize number
public normalize ( ) : Number
Résultat Number

offsetExists() public méthode

public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset )

offsetSet() public méthode

public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

output() public méthode

Output number
public output ( Compiler $compiler = null ) : string
$compiler Leafo\ScssPhp\Compiler
Résultat string

unitStr() public méthode

Returns unit(s) as the product of numerator units divided by the product of denominator units
public unitStr ( ) : string
Résultat string

unitless() public méthode

Returns true if the number is unitless
public unitless ( ) : boolean
Résultat boolean

Property Details

$dimension public_oe property

public int|float $dimension
Résultat integer | float

$precision public_oe static_oe property

public static int $precision
Résultat integer

$unitTable protected_oe static_oe property

See also: http://www.w3.org/TR/2012/WD-css3-values-20120308/
protected static array $unitTable
Résultat array

$units public_oe property

public array $units
Résultat array