You are here

private function SassNumber::areConvertable in Sassy 7

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

* Returns a value indicating if all the units are capable of being converted *

Parameters

array units to test: * @return boolean true if all units can be converted, false if not

1 call to SassNumber::areConvertable()
SassNumber::coercionFactor in phamlp/sass/script/literals/SassNumber.php
* Calculates the corecion factor to apply to the value *

File

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

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

private function areConvertable($units) {
  $convertable = array_keys(self::$unitConversion);
  foreach ($units as $unit) {
    if (!in_array($unit, $convertable)) {
      return false;
    }
  }
  return true;
}