Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
Less_Tree_Negative | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
genCSS | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
compile | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * @private |
4 | */ |
5 | class Less_Tree_Negative extends Less_Tree implements Less_Tree_HasValueProperty { |
6 | |
7 | public $value; |
8 | |
9 | public function __construct( $node ) { |
10 | $this->value = $node; |
11 | } |
12 | |
13 | /** |
14 | * @see Less_Tree::genCSS |
15 | */ |
16 | public function genCSS( $output ) { |
17 | $output->add( '-' ); |
18 | $this->value->genCSS( $output ); |
19 | } |
20 | |
21 | public function compile( $env ) { |
22 | if ( $env->isMathOn() ) { |
23 | $ret = new Less_Tree_Operation( '*', [ new Less_Tree_Dimension( -1 ), $this->value ] ); |
24 | return $ret->compile( $env ); |
25 | } |
26 | return new self( $this->value->compile( $env ) ); |
27 | } |
28 | } |