Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
85.71% |
6 / 7 |
|
75.00% |
3 / 4 |
CRAP | |
0.00% |
0 / 1 |
Less_Tree_DefaultFunc | |
85.71% |
6 / 7 |
|
75.00% |
3 / 4 |
7.14 | |
0.00% |
0 / 1 |
compile | |
75.00% |
3 / 4 |
|
0.00% |
0 / 1 |
4.25 | |||
value | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
error | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
reset | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * @private |
4 | */ |
5 | class Less_Tree_DefaultFunc { |
6 | |
7 | private static $error_; |
8 | private static $value_; |
9 | |
10 | public static function compile() { |
11 | if ( self::$error_ ) { |
12 | throw new Exception( self::$error_ ); |
13 | } |
14 | if ( self::$value_ !== null ) { |
15 | return self::$value_ ? new Less_Tree_Keyword( 'true' ) : new Less_Tree_Keyword( 'false' ); |
16 | } |
17 | } |
18 | |
19 | public static function value( $v ) { |
20 | self::$value_ = $v; |
21 | } |
22 | |
23 | public static function error( $e ) { |
24 | self::$error_ = $e; |
25 | } |
26 | |
27 | public static function reset() { |
28 | self::$value_ = self::$error_ = null; |
29 | } |
30 | } |