You are here

public function SassNumber::op_modulo in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/script/literals/SassNumber.php \SassNumber::op_modulo()

* Takes the modulus (remainder) of this value divided by the value of other *

Parameters

string value to divide by: * @return mixed SassNumber if other is a SassNumber or * SassColour if it is a SassColour

Overrides SassLiteral::op_modulo

File

phamlp/sass/script/literals/SassNumber.php, line 276

Class

SassNumber
SassNumber class. Provides operations and type testing for Sass numbers. Units are of the passed value are converted the those of the class value if it has units. e.g. 2cm + 20mm = 4cm while 2 + 20mm =…

Code

public function op_modulo($other) {
  if (!$other instanceof SassNumber || !$other
    ->isUnitless()) {
    throw new SassNumberException('{what} must be a {type}', array(
      '{what}' => Phamlp::t('sass', 'Number'),
      '{type}' => Phamlp::t('sass', 'unitless number'),
    ), SassScriptParser::$context->node);
  }
  $this->value %= $this
    ->convert($other)->value;
  return $this;
}