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 | /** @var Less_Tree */ |
8 | public $value; |
9 | |
10 | public function __construct( $node ) { |
11 | $this->value = $node; |
12 | } |
13 | |
14 | /** |
15 | * @see Less_Tree::genCSS |
16 | */ |
17 | public function genCSS( $output ) { |
18 | $output->add( '-' ); |
19 | $this->value->genCSS( $output ); |
20 | } |
21 | |
22 | public function compile( $env ) { |
23 | if ( $env->isMathOn() ) { |
24 | $ret = new Less_Tree_Operation( '*', [ new Less_Tree_Dimension( -1 ), $this->value ] ); |
25 | return $ret->compile( $env ); |
26 | } |
27 | return new self( $this->value->compile( $env ) ); |
28 | } |
29 | } |