public function SassBoolean::__construct in Sassy 7.3
Same name and namespace in other branches
- 7 phamlp/sass/script/literals/SassBoolean.php \SassBoolean::__construct()
SassBoolean constructor
Parameters
string value of the boolean type:
Return value
Overrides SassLiteral::__construct
File
- phpsass/
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 SassBoolean', SassScriptParser::$context->node);
}
}