You are here

public function SassBoolean::__construct in Sassy 7

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

* SassBoolean constructor *

Parameters

string value of the boolean type: * @return SassBoolean

Overrides SassLiteral::__construct

File

phamlp/sass/script/literals/SassBoolean.php, line 30

Class

SassBoolean
SassBoolean class. @package PHamlP @subpackage Sass.script.literals

Code

public function __construct($value) {
  if (is_bool($value)) {
    $this->value = $value;
  }
  elseif ($value === 'true' || $value === 'false') {
    $this->value = $value === 'true' ? true : false;
  }
  else {
    throw new SassBooleanException('Invalid {what}', array(
      '{what}' => 'SassBoolean',
    ), SassScriptParser::$context->node);
  }
}