Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
10 / 10 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
Less_Tree_DetachedRuleset | |
100.00% |
10 / 10 |
|
100.00% |
4 / 4 |
6 | |
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% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
callEval | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * @private |
4 | */ |
5 | class Less_Tree_DetachedRuleset extends Less_Tree { |
6 | |
7 | public $ruleset; |
8 | public $frames; |
9 | |
10 | public function __construct( $ruleset, $frames = null ) { |
11 | $this->ruleset = $ruleset; |
12 | $this->frames = $frames; |
13 | } |
14 | |
15 | public function accept( $visitor ) { |
16 | $this->ruleset = $visitor->visitObj( $this->ruleset ); |
17 | } |
18 | |
19 | public function compile( $env ) { |
20 | if ( $this->frames ) { |
21 | $frames = $this->frames; |
22 | } else { |
23 | $frames = $env->frames; |
24 | } |
25 | return new self( $this->ruleset, $frames ); |
26 | } |
27 | |
28 | public function callEval( $env ) { |
29 | if ( $this->frames ) { |
30 | return $this->ruleset->compile( $env->copyEvalEnv( array_merge( $this->frames, $env->frames ) ) ); |
31 | } |
32 | return $this->ruleset->compile( $env ); |
33 | } |
34 | } |