| 1 |
<?php |
| 2 |
/** |
| 3 |
* @private |
| 4 |
*/ |
| 5 |
class Less_Tree_DefaultFunc { |
| 6 |
|
| 7 |
/** @var string|null */ |
| 8 |
private static $error_; |
| 9 |
/** @var int|null */ |
| 10 |
private static $value_; |
| 11 |
|
| 12 |
public static function compile() { |
| 13 |
if ( self::$error_ ) { |
| 14 |
throw new Exception( self::$error_ ); |
| 15 |
} |
| 16 |
if ( self::$value_ !== null ) { |
| 17 |
return self::$value_ ? new Less_Tree_Keyword( 'true' ) : new Less_Tree_Keyword( 'false' ); |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
public static function value( $v ) { |
| 22 |
self::$value_ = $v; |
| 23 |
} |
| 24 |
|
| 25 |
public static function error( $e ) { |
| 26 |
self::$error_ = $e; |
| 27 |
} |
| 28 |
|
| 29 |
public static function reset() { |
| 30 |
self::$value_ = self::$error_ = null; |
| 31 |
} |
| 32 |
} |