Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
11 / 11 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
Less_Tree_Alpha | |
100.00% |
11 / 11 |
|
100.00% |
4 / 4 |
7 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
accept | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
compile | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
genCSS | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * @private |
4 | * @see less-2.5.3.js#Alpha.prototype |
5 | */ |
6 | class Less_Tree_Alpha extends Less_Tree implements Less_Tree_HasValueProperty { |
7 | public $value; |
8 | |
9 | /** |
10 | * @param string|Less_Tree $val This receives string or Less_Tree_Variable |
11 | * from Less_Parser. In compile(), Less_Tree_Variable is replaced with a |
12 | * different node (e.g. Less_Tree_Quoted). |
13 | */ |
14 | public function __construct( $val ) { |
15 | $this->value = $val; |
16 | } |
17 | |
18 | public function accept( $visitor ) { |
19 | if ( $this->value instanceof Less_Tree ) { |
20 | $this->value = $visitor->visitObj( $this->value ); |
21 | } |
22 | } |
23 | |
24 | public function compile( $env ) { |
25 | if ( $this->value instanceof Less_Tree ) { |
26 | return new self( $this->value->compile( $env ) ); |
27 | } |
28 | |
29 | return $this; |
30 | } |
31 | |
32 | public function genCSS( $output ) { |
33 | $output->add( "alpha(opacity=" ); |
34 | |
35 | if ( $this->value instanceof Less_Tree ) { |
36 | $this->value->genCSS( $output ); |
37 | } else { |
38 | $output->add( $this->value ); |
39 | } |
40 | |
41 | $output->add( ')' ); |
42 | } |
43 | } |