Leafo\ScssPhp\Node\Number
Dimension + optional units
{@internal
This is a work-in-progress.
The \ArrayAccess interface is temporary until the migration is complete.
}}
- Author: Anthon Pang <anthon.pang@gmail.com>
Synopsis
class Number
extends Node
implements
ArrayAccess
{
- // members
- public static integer $precision = 5;
- protected static array $unitTable = ;
- public integer|float $dimension;
- public $units;
- // Inherited members from Node
- public $type;
- public $sourceIndex;
- public $sourceLine;
- public $sourceColumn;
- // methods
- public void __construct()
- public Number coerce()
- public Number normalize()
- public void offsetExists()
- public void offsetGet()
- public void offsetSet()
- public void offsetUnset()
- public boolean unitless()
- public string unitStr()
- public string output()
- public void __toString()
- private void normalizeUnits()
Hierarchy
Violations
PHPMessDetector
Line | Rule | Message |
---|---|---|
29 - 329 | TooManyPublicMethods | The class Number has 11 public methods. Consider refactoring Number to keep number of public methods under 10. |
29 - 329 | ExcessiveClassComplexity | The class Number has an overall complexity of 53 which is very high. The configured complexity threshold is 50. |
Members
protected
- $unitTable — array
public
- $dimension — Leafo\ScssPhp\Node\integer|float
- $precision — integer
- $sourceColumn — integer
- $sourceIndex — integer
- $sourceLine — integer
- $type — string
- $units — array
Methods
private
- normalizeUnits() — Normalize units
public
- __construct() — Initialize number
- __toString() — {@inheritdoc}
- coerce() — Coerce number to target units
- normalize() — Normalize number
- offsetExists() — {@inheritdoc}
- offsetGet() — {@inheritdoc}
- offsetSet() — {@inheritdoc}
- offsetUnset() — {@inheritdoc}
- output() — Output number
- unitStr() — Returns unit(s) as the product of numerator units divided by the product of denominator units
- unitless() — Returns true if the number is unitless
History
-
2017-05-18T21:45:34+00:00 (commit #62babba)
Author: Limych (andrey@khrolenok.ru) / Commiter: Limych (andrey@khrolenok.ru)
Pre 3.0.0
-
2017-05-17T09:50:09+00:00 (commit #bcd6e9c)
Author: Limych (andrey@khrolenok.ru) / Commiter: Limych (andrey@khrolenok.ru)
PSR-2
-
2017-05-16T19:52:59+00:00 (commit #fd0a296)
Author: Limych (andrey@khrolenok.ru) / Commiter: Limych (andrey@khrolenok.ru)
PSR-2 applied
-
2016-01-25T17:45:50+00:00 (commit #97e2af2)
Author: Limych (andrey@khrolenok.ru) / Commiter: Limych (andrey@khrolenok.ru)
Pre v.3.0