Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

SCSSPHP

Copyright: 2012-2019 Leaf Corcoran
License: http://opensource.org/licenses/MIT MIT
File Size: 330 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Number:: (12 methods):
  __construct()
  coerce()
  normalize()
  offsetExists()
  offsetGet()
  offsetSet()
  offsetUnset()
  unitless()
  unitStr()
  output()
  __toString()
  normalizeUnits()


Class: Number  - X-Ref

Dimension + optional units

{@internal
This is a work-in-progress.

The \ArrayAccess interface is temporary until the migration is complete.
}}

__construct($dimension, $initialUnit)   X-Ref
Initialize number

param: mixed $dimension
param: mixed $initialUnit

coerce($units)   X-Ref
Coerce number to target units

param: array $units
return: \ScssPhp\ScssPhp\Node\Number

normalize()   X-Ref
Normalize number

return: \ScssPhp\ScssPhp\Node\Number

offsetExists($offset)   X-Ref
{@inheritdoc}


offsetGet($offset)   X-Ref
{@inheritdoc}


offsetSet($offset, $value)   X-Ref
{@inheritdoc}


offsetUnset($offset)   X-Ref
{@inheritdoc}


unitless()   X-Ref
Returns true if the number is unitless

return: boolean

unitStr()   X-Ref
Returns unit(s) as the product of numerator units divided by the product of denominator units

return: string

output(Compiler $compiler = null)   X-Ref
Output number

param: \ScssPhp\ScssPhp\Compiler $compiler
return: string

__toString()   X-Ref
{@inheritdoc}


normalizeUnits(&$dimension, &$units, $baseUnit = 'in')   X-Ref
Normalize units

param: integer|float $dimension
param: array         $units
param: string        $baseUnit