You are here

public function Number::__construct in SCSS Compiler 1.0.x

Constructs a Number object.

Parameters

float $value: The magnitude of the number.

string|null $unit: The unit of the number. Must be supported by the underlying compiler.

File

src/Type/Number.php, line 39

Class

Number
Defines a Sass number type optionally paired with a unit.

Namespace

Drupal\compiler_scss\Type

Code

public function __construct(float $value, ?string $unit = NULL) {
  if (isset($unit) && !is_string($unit)) {
    throw new \RuntimeException('$unit must be a string or NULL');
  }
  $this->value = $value;
  $this->unit = $unit;
}