Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
61.29% covered (warning)
61.29%
19 / 31
57.14% covered (warning)
57.14%
4 / 7
CRAP
0.00% covered (danger)
0.00%
0 / 1
Less_Tree
61.29% covered (warning)
61.29%
19 / 31
57.14% covered (warning)
57.14%
4 / 7
22.80
0.00% covered (danger)
0.00%
0 / 1
 toCSS
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 genCSS
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 compile
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 outputRuleset
64.71% covered (warning)
64.71%
11 / 17
0.00% covered (danger)
0.00%
0 / 1
4.70
 accept
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 ReferencedArray
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
3
 __set_state
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3/**
4 * Tree
5 */
6class Less_Tree {
7
8    public $parensInOp = false;
9    public $extendOnEveryPath;
10    public $allExtends;
11
12    public function toCSS() {
13        $output = new Less_Output();
14        $this->genCSS( $output );
15        return $output->toString();
16    }
17
18    /**
19     * Generate CSS by adding it to the output object
20     *
21     * @param Less_Output $output The output
22     * @return void
23     */
24    public function genCSS( $output ) {
25    }
26
27    public function compile( $env ) {
28        return $this;
29    }
30
31    /**
32     * @param Less_Output $output
33     * @param Less_Tree_Ruleset[] $rules
34     */
35    public static function outputRuleset( $output, $rules ) {
36        $ruleCnt = count( $rules );
37        Less_Environment::$tabLevel++;
38
39        // Compressed
40        if ( Less_Parser::$options['compress'] ) {
41            $output->add( '{' );
42            for ( $i = 0; $i < $ruleCnt; $i++ ) {
43                $rules[$i]->genCSS( $output );
44            }
45
46            $output->add( '}' );
47            Less_Environment::$tabLevel--;
48            return;
49        }
50
51        // Non-compressed
52        $tabSetStr = "\n" . str_repeat( Less_Parser::$options['indentation'], Less_Environment::$tabLevel - 1 );
53        $tabRuleStr = $tabSetStr . Less_Parser::$options['indentation'];
54
55        $output->add( " {" );
56        for ( $i = 0; $i < $ruleCnt; $i++ ) {
57            $output->add( $tabRuleStr );
58            $rules[$i]->genCSS( $output );
59        }
60        Less_Environment::$tabLevel--;
61        $output->add( $tabSetStr . '}' );
62    }
63
64    public function accept( $visitor ) {
65    }
66
67    public static function ReferencedArray( $rules ) {
68        foreach ( $rules as $rule ) {
69            if ( method_exists( $rule, 'markReferenced' ) ) {
70                // @phan-suppress-next-line PhanUndeclaredMethod
71                $rule->markReferenced();
72            }
73        }
74    }
75
76    /**
77     * Requires php 5.3+
78     */
79    public static function __set_state( $args ) {
80        $class = get_called_class();
81        $obj = new $class( null, null, null, null );
82        foreach ( $args as $key => $val ) {
83            $obj->$key = $val;
84        }
85        return $obj;
86    }
87
88}