Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
15 / 15 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
Less_Tree_Value | |
100.00% |
15 / 15 |
|
100.00% |
4 / 4 |
9 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
accept | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
compile | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 | |||
genCSS | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
4 |
1 | <?php |
2 | /** |
3 | * @private |
4 | */ |
5 | class Less_Tree_Value extends Less_Tree implements Less_Tree_HasValueProperty { |
6 | |
7 | /** @var Less_Tree[] */ |
8 | public $value; |
9 | |
10 | public $index; |
11 | public $currentFileInfo; |
12 | |
13 | /** |
14 | * @param array<Less_Tree> $value |
15 | */ |
16 | public function __construct( $value, $index = null ) { |
17 | $this->value = $value; |
18 | $this->index = $index; |
19 | } |
20 | |
21 | public function accept( $visitor ) { |
22 | $this->value = $visitor->visitArray( $this->value ); |
23 | } |
24 | |
25 | public function compile( $env ) { |
26 | $ret = []; |
27 | $i = 0; |
28 | foreach ( $this->value as $i => $v ) { |
29 | $ret[] = $v->compile( $env ); |
30 | } |
31 | if ( $i > 0 ) { |
32 | return new self( $ret ); |
33 | } |
34 | return $ret[0]; |
35 | } |
36 | |
37 | /** |
38 | * @see less-2.5.3.js#Value.prototype.genCSS |
39 | */ |
40 | public function genCSS( $output ) { |
41 | $len = count( $this->value ); |
42 | for ( $i = 0; $i < $len; $i++ ) { |
43 | $this->value[$i]->genCSS( $output ); |
44 | if ( $i + 1 < $len ) { |
45 | $output->add( Less_Parser::$options['compress'] ? ',' : ', ' ); |
46 | } |
47 | } |
48 | } |
49 | |
50 | } |