PHP Класс Leafo\ScssPhp\Node\Number

{@internal This is a work-in-progress. The \ArrayAccess interface is temporary until the migration is complete.}}
Автор: Anthon Pang ([email protected])
Наследование: extends Leafo\ScssPhp\Node, implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$dimension integer | float
$precision integer
$units array

Защищенные свойства (Protected)

Свойство Тип Описание
$unitTable array

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

Метод Описание
__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

Приватные методы

Метод Описание
normalizeUnits ( integer | float &$dimension, array &$units, string $baseUnit = 'in' ) Normalize units

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

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

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

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

public __toString ( )

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

Coerce number to target units
public coerce ( array $units ) : Number
$units array
Результат Number

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

Normalize number
public normalize ( ) : Number
Результат Number

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

public offsetExists ( $offset )

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

public offsetGet ( $offset )

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

public offsetSet ( $offset, $value )

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

public offsetUnset ( $offset )

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

Output number
public output ( Compiler $compiler = null ) : string
$compiler Leafo\ScssPhp\Compiler
Результат string

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

Returns unit(s) as the product of numerator units divided by the product of denominator units
public unitStr ( ) : string
Результат string

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

Returns true if the number is unitless
public unitless ( ) : boolean
Результат boolean

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

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

public int|float $dimension
Результат integer | float

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

public static int $precision
Результат integer

$unitTable защищенное статическое свойство

См. также: http://www.w3.org/TR/2012/WD-css3-values-20120308/
protected static array $unitTable
Результат array

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

public array $units
Результат array