@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | $this->variable = ( is_string($name) && $name[0] === '@'); |
33 | 33 | } |
34 | 34 | |
35 | - public function accept($visitor) { |
|
35 | + public function accept($visitor) { |
|
36 | 36 | $this->value = $visitor->visitObj( $this->value ); |
37 | 37 | } |
38 | 38 | |
39 | - /** |
|
40 | - * @see Less_Tree::genCSS |
|
41 | - */ |
|
42 | - public function genCSS( $output ){ |
|
39 | + /** |
|
40 | + * @see Less_Tree::genCSS |
|
41 | + */ |
|
42 | + public function genCSS( $output ){ |
|
43 | 43 | |
44 | 44 | $output->add( $this->name . Less_Environment::$_outputMap[': '], $this->currentFileInfo, $this->index); |
45 | 45 | try{ |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | |
103 | - public function CompileName( $env, $name ){ |
|
103 | + public function CompileName( $env, $name ){ |
|
104 | 104 | $output = new Less_Output(); |
105 | 105 | foreach($name as $n){ |
106 | 106 | $n->compile($env)->genCSS($output); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return $output->toString(); |
109 | 109 | } |
110 | 110 | |
111 | - public function makeImportant(){ |
|
111 | + public function makeImportant(){ |
|
112 | 112 | return new Less_Tree_Rule($this->name, $this->value, '!important', $this->merge, $this->index, $this->currentFileInfo, $this->inline); |
113 | 113 | } |
114 | 114 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_Rule extends Less_Tree{ |
|
9 | +class Less_Tree_Rule extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $name; |
12 | 12 | public $value; |
@@ -21,73 +21,73 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @param string $important |
23 | 23 | */ |
24 | - public function __construct($name, $value = null, $important = null, $merge = null, $index = null, $currentFileInfo = null, $inline = false){ |
|
24 | + public function __construct($name, $value = null, $important = null, $merge = null, $index = null, $currentFileInfo = null, $inline = false) { |
|
25 | 25 | $this->name = $name; |
26 | 26 | $this->value = ($value instanceof Less_Tree_Value || $value instanceof Less_Tree_Ruleset) ? $value : new Less_Tree_Value(array($value)); |
27 | - $this->important = $important ? ' ' . trim($important) : ''; |
|
27 | + $this->important = $important ? ' '.trim($important) : ''; |
|
28 | 28 | $this->merge = $merge; |
29 | 29 | $this->index = $index; |
30 | 30 | $this->currentFileInfo = $currentFileInfo; |
31 | 31 | $this->inline = $inline; |
32 | - $this->variable = ( is_string($name) && $name[0] === '@'); |
|
32 | + $this->variable = (is_string($name) && $name[0]==='@'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function accept($visitor) { |
36 | - $this->value = $visitor->visitObj( $this->value ); |
|
36 | + $this->value = $visitor->visitObj($this->value); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | 40 | * @see Less_Tree::genCSS |
41 | 41 | */ |
42 | - public function genCSS( $output ){ |
|
42 | + public function genCSS($output) { |
|
43 | 43 | |
44 | - $output->add( $this->name . Less_Environment::$_outputMap[': '], $this->currentFileInfo, $this->index); |
|
45 | - try{ |
|
46 | - $this->value->genCSS( $output); |
|
44 | + $output->add($this->name.Less_Environment::$_outputMap[': '], $this->currentFileInfo, $this->index); |
|
45 | + try { |
|
46 | + $this->value->genCSS($output); |
|
47 | 47 | |
48 | - }catch( Less_Exception_Parser $e ){ |
|
48 | + } catch (Less_Exception_Parser $e) { |
|
49 | 49 | $e->index = $this->index; |
50 | 50 | $e->currentFile = $this->currentFileInfo; |
51 | 51 | throw $e; |
52 | 52 | } |
53 | - $output->add( $this->important . (($this->inline || (Less_Environment::$lastRule && Less_Parser::$options['compress'])) ? "" : ";"), $this->currentFileInfo, $this->index); |
|
53 | + $output->add($this->important.(($this->inline || (Less_Environment::$lastRule && Less_Parser::$options['compress'])) ? "" : ";"), $this->currentFileInfo, $this->index); |
|
54 | 54 | } |
55 | 55 | |
56 | - public function compile ($env){ |
|
56 | + public function compile($env) { |
|
57 | 57 | |
58 | 58 | $name = $this->name; |
59 | - if( is_array($name) ){ |
|
59 | + if (is_array($name)) { |
|
60 | 60 | // expand 'primitive' name directly to get |
61 | 61 | // things faster (~10% for benchmark.less): |
62 | - if( count($name) === 1 && $name[0] instanceof Less_Tree_Keyword ){ |
|
62 | + if (count($name)===1 && $name[0] instanceof Less_Tree_Keyword) { |
|
63 | 63 | $name = $name[0]->value; |
64 | - }else{ |
|
65 | - $name = $this->CompileName($env,$name); |
|
64 | + }else { |
|
65 | + $name = $this->CompileName($env, $name); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | $strictMathBypass = Less_Parser::$options['strictMath']; |
70 | - if( $name === "font" && !Less_Parser::$options['strictMath'] ){ |
|
70 | + if ($name==="font" && !Less_Parser::$options['strictMath']) { |
|
71 | 71 | Less_Parser::$options['strictMath'] = true; |
72 | 72 | } |
73 | 73 | |
74 | 74 | try { |
75 | 75 | $evaldValue = $this->value->compile($env); |
76 | 76 | |
77 | - if( !$this->variable && $evaldValue->type === "DetachedRuleset") { |
|
77 | + if (!$this->variable && $evaldValue->type==="DetachedRuleset") { |
|
78 | 78 | throw new Less_Exception_Compiler("Rulesets cannot be evaluated on a property.", null, $this->index, $this->currentFileInfo); |
79 | 79 | } |
80 | 80 | |
81 | - if( Less_Environment::$mixin_stack ){ |
|
81 | + if (Less_Environment::$mixin_stack) { |
|
82 | 82 | $return = new Less_Tree_Rule($name, $evaldValue, $this->important, $this->merge, $this->index, $this->currentFileInfo, $this->inline); |
83 | - }else{ |
|
83 | + }else { |
|
84 | 84 | $this->name = $name; |
85 | 85 | $this->value = $evaldValue; |
86 | 86 | $return = $this; |
87 | 87 | } |
88 | 88 | |
89 | - }catch( Less_Exception_Parser $e ){ |
|
90 | - if( !is_numeric($e->index) ){ |
|
89 | + } catch (Less_Exception_Parser $e) { |
|
90 | + if (!is_numeric($e->index)) { |
|
91 | 91 | $e->index = $this->index; |
92 | 92 | $e->currentFile = $this->currentFileInfo; |
93 | 93 | } |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | |
103 | - public function CompileName( $env, $name ){ |
|
103 | + public function CompileName($env, $name) { |
|
104 | 104 | $output = new Less_Output(); |
105 | - foreach($name as $n){ |
|
105 | + foreach ($name as $n) { |
|
106 | 106 | $n->compile($env)->genCSS($output); |
107 | 107 | } |
108 | 108 | return $output->toString(); |
109 | 109 | } |
110 | 110 | |
111 | - public function makeImportant(){ |
|
111 | + public function makeImportant() { |
|
112 | 112 | return new Less_Tree_Rule($this->name, $this->value, '!important', $this->merge, $this->index, $this->currentFileInfo, $this->inline); |
113 | 113 | } |
114 | 114 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | try{ |
46 | 46 | $this->value->genCSS( $output); |
47 | 47 | |
48 | - }catch( Less_Exception_Parser $e ){ |
|
48 | + } catch( Less_Exception_Parser $e ){ |
|
49 | 49 | $e->index = $this->index; |
50 | 50 | $e->currentFile = $this->currentFileInfo; |
51 | 51 | throw $e; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | // things faster (~10% for benchmark.less): |
62 | 62 | if( count($name) === 1 && $name[0] instanceof Less_Tree_Keyword ){ |
63 | 63 | $name = $name[0]->value; |
64 | - }else{ |
|
64 | + } else{ |
|
65 | 65 | $name = $this->CompileName($env,$name); |
66 | 66 | } |
67 | 67 | } |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | |
81 | 81 | if( Less_Environment::$mixin_stack ){ |
82 | 82 | $return = new Less_Tree_Rule($name, $evaldValue, $this->important, $this->merge, $this->index, $this->currentFileInfo, $this->inline); |
83 | - }else{ |
|
83 | + } else{ |
|
84 | 84 | $this->name = $name; |
85 | 85 | $this->value = $evaldValue; |
86 | 86 | $return = $this; |
87 | 87 | } |
88 | 88 | |
89 | - }catch( Less_Exception_Parser $e ){ |
|
89 | + } catch( Less_Exception_Parser $e ){ |
|
90 | 90 | if( !is_numeric($e->index) ){ |
91 | 91 | $e->index = $this->index; |
92 | 92 | $e->currentFile = $this->currentFileInfo; |
@@ -11,13 +11,13 @@ |
||
11 | 11 | public $variable; |
12 | 12 | public $type = "RulesetCall"; |
13 | 13 | |
14 | - public function __construct($variable){ |
|
14 | + public function __construct($variable){ |
|
15 | 15 | $this->variable = $variable; |
16 | 16 | } |
17 | 17 | |
18 | - public function accept($visitor) {} |
|
18 | + public function accept($visitor) {} |
|
19 | 19 | |
20 | - public function compile( $env ){ |
|
20 | + public function compile( $env ){ |
|
21 | 21 | $variable = new Less_Tree_Variable($this->variable); |
22 | 22 | $detachedRuleset = $variable->compile($env); |
23 | 23 | return $detachedRuleset->callEval($env); |
@@ -6,18 +6,18 @@ |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_RulesetCall extends Less_Tree{ |
|
9 | +class Less_Tree_RulesetCall extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $variable; |
12 | 12 | public $type = "RulesetCall"; |
13 | 13 | |
14 | - public function __construct($variable){ |
|
14 | + public function __construct($variable) { |
|
15 | 15 | $this->variable = $variable; |
16 | 16 | } |
17 | 17 | |
18 | 18 | public function accept($visitor) {} |
19 | 19 | |
20 | - public function compile( $env ){ |
|
20 | + public function compile($env) { |
|
21 | 21 | $variable = new Less_Tree_Variable($this->variable); |
22 | 22 | $detachedRuleset = $variable->compile($env); |
23 | 23 | return $detachedRuleset->callEval($env); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $this->CacheElements(); |
46 | 46 | } |
47 | 47 | |
48 | - public function accept($visitor) { |
|
48 | + public function accept($visitor) { |
|
49 | 49 | $this->elements = $visitor->visitArray($this->elements); |
50 | 50 | $this->extendList = $visitor->visitArray($this->extendList); |
51 | 51 | if( $this->condition ){ |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - public function createDerived( $elements, $extendList = null, $evaldCondition = null ){ |
|
60 | + public function createDerived( $elements, $extendList = null, $evaldCondition = null ){ |
|
61 | 61 | $newSelector = new Less_Tree_Selector( $elements, ($extendList ? $extendList : $this->extendList), null, $this->index, $this->currentFileInfo, $this->isReferenced); |
62 | 62 | $newSelector->evaldCondition = $evaldCondition ? $evaldCondition : $this->evaldCondition; |
63 | 63 | return $newSelector; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /** |
143 | 143 | * @see Less_Tree::genCSS |
144 | 144 | */ |
145 | - public function genCSS( $output, $firstSelector = true ){ |
|
145 | + public function genCSS( $output, $firstSelector = true ){ |
|
146 | 146 | |
147 | 147 | if( !$firstSelector && $this->elements[0]->combinator === "" ){ |
148 | 148 | $output->add(' ', $this->currentFileInfo, $this->index); |
@@ -153,15 +153,15 @@ discard block |
||
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | - public function markReferenced(){ |
|
156 | + public function markReferenced(){ |
|
157 | 157 | $this->isReferenced = true; |
158 | 158 | } |
159 | 159 | |
160 | - public function getIsReferenced(){ |
|
160 | + public function getIsReferenced(){ |
|
161 | 161 | return !isset($this->currentFileInfo['reference']) || !$this->currentFileInfo['reference'] || $this->isReferenced; |
162 | 162 | } |
163 | 163 | |
164 | - public function getIsOutput(){ |
|
164 | + public function getIsOutput(){ |
|
165 | 165 | return $this->evaldCondition; |
166 | 166 | } |
167 | 167 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_Selector extends Less_Tree{ |
|
9 | +class Less_Tree_Selector extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $elements; |
12 | 12 | public $condition; |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * @param boolean $isReferenced |
30 | 30 | */ |
31 | - public function __construct( $elements, $extendList = array() , $condition = null, $index=null, $currentFileInfo=null, $isReferenced=null ){ |
|
31 | + public function __construct($elements, $extendList = array(), $condition = null, $index = null, $currentFileInfo = null, $isReferenced = null) { |
|
32 | 32 | |
33 | 33 | $this->elements = $elements; |
34 | 34 | $this->elements_len = count($elements); |
35 | 35 | $this->extendList = $extendList; |
36 | 36 | $this->condition = $condition; |
37 | - if( $currentFileInfo ){ |
|
37 | + if ($currentFileInfo) { |
|
38 | 38 | $this->currentFileInfo = $currentFileInfo; |
39 | 39 | } |
40 | 40 | $this->isReferenced = $isReferenced; |
41 | - if( !$condition ){ |
|
41 | + if (!$condition) { |
|
42 | 42 | $this->evaldCondition = true; |
43 | 43 | } |
44 | 44 | |
@@ -48,30 +48,30 @@ discard block |
||
48 | 48 | public function accept($visitor) { |
49 | 49 | $this->elements = $visitor->visitArray($this->elements); |
50 | 50 | $this->extendList = $visitor->visitArray($this->extendList); |
51 | - if( $this->condition ){ |
|
51 | + if ($this->condition) { |
|
52 | 52 | $this->condition = $visitor->visitObj($this->condition); |
53 | 53 | } |
54 | 54 | |
55 | - if( $visitor instanceof Less_Visitor_extendFinder ){ |
|
55 | + if ($visitor instanceof Less_Visitor_extendFinder) { |
|
56 | 56 | $this->CacheElements(); |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - public function createDerived( $elements, $extendList = null, $evaldCondition = null ){ |
|
61 | - $newSelector = new Less_Tree_Selector( $elements, ($extendList ? $extendList : $this->extendList), null, $this->index, $this->currentFileInfo, $this->isReferenced); |
|
60 | + public function createDerived($elements, $extendList = null, $evaldCondition = null) { |
|
61 | + $newSelector = new Less_Tree_Selector($elements, ($extendList ? $extendList : $this->extendList), null, $this->index, $this->currentFileInfo, $this->isReferenced); |
|
62 | 62 | $newSelector->evaldCondition = $evaldCondition ? $evaldCondition : $this->evaldCondition; |
63 | 63 | return $newSelector; |
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | - public function match( $other ){ |
|
67 | + public function match($other) { |
|
68 | 68 | |
69 | - if( !$other->_oelements || ($this->elements_len < $other->_oelements_len) ){ |
|
69 | + if (!$other->_oelements || ($this->elements_len<$other->_oelements_len)) { |
|
70 | 70 | return 0; |
71 | 71 | } |
72 | 72 | |
73 | - for( $i = 0; $i < $other->_oelements_len; $i++ ){ |
|
74 | - if( $this->elements[$i]->value !== $other->_oelements[$i]) { |
|
73 | + for ($i = 0; $i<$other->_oelements_len; $i++) { |
|
74 | + if ($this->elements[$i]->value!==$other->_oelements[$i]) { |
|
75 | 75 | return 0; |
76 | 76 | } |
77 | 77 | } |
@@ -80,20 +80,20 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | - public function CacheElements(){ |
|
83 | + public function CacheElements() { |
|
84 | 84 | |
85 | 85 | $this->_oelements = array(); |
86 | 86 | $css = ''; |
87 | 87 | |
88 | - foreach($this->elements as $v){ |
|
88 | + foreach ($this->elements as $v) { |
|
89 | 89 | |
90 | 90 | $css .= $v->combinator; |
91 | - if( !$v->value_is_object ){ |
|
91 | + if (!$v->value_is_object) { |
|
92 | 92 | $css .= $v->value; |
93 | 93 | continue; |
94 | 94 | } |
95 | 95 | |
96 | - if( !property_exists($v->value,'value') || !is_string($v->value->value) ){ |
|
96 | + if (!property_exists($v->value, 'value') || !is_string($v->value->value)) { |
|
97 | 97 | $this->cacheable = false; |
98 | 98 | return; |
99 | 99 | } |
@@ -101,67 +101,67 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | $this->_oelements_len = preg_match_all('/[,&#\.\w-](?:[\w-]|(?:\\\\.))*/', $css, $matches); |
104 | - if( $this->_oelements_len ){ |
|
104 | + if ($this->_oelements_len) { |
|
105 | 105 | $this->_oelements = $matches[0]; |
106 | 106 | |
107 | - if( $this->_oelements[0] === '&' ){ |
|
107 | + if ($this->_oelements[0]==='&') { |
|
108 | 108 | array_shift($this->_oelements); |
109 | 109 | $this->_oelements_len--; |
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | - public function isJustParentSelector(){ |
|
114 | + public function isJustParentSelector() { |
|
115 | 115 | return !$this->mediaEmpty && |
116 | - count($this->elements) === 1 && |
|
117 | - $this->elements[0]->value === '&' && |
|
118 | - ($this->elements[0]->combinator === ' ' || $this->elements[0]->combinator === ''); |
|
116 | + count($this->elements)===1 && |
|
117 | + $this->elements[0]->value==='&' && |
|
118 | + ($this->elements[0]->combinator===' ' || $this->elements[0]->combinator===''); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | public function compile($env) { |
122 | 122 | |
123 | 123 | $elements = array(); |
124 | - foreach($this->elements as $el){ |
|
124 | + foreach ($this->elements as $el) { |
|
125 | 125 | $elements[] = $el->compile($env); |
126 | 126 | } |
127 | 127 | |
128 | 128 | $extendList = array(); |
129 | - foreach($this->extendList as $el){ |
|
129 | + foreach ($this->extendList as $el) { |
|
130 | 130 | $extendList[] = $el->compile($el); |
131 | 131 | } |
132 | 132 | |
133 | 133 | $evaldCondition = false; |
134 | - if( $this->condition ){ |
|
134 | + if ($this->condition) { |
|
135 | 135 | $evaldCondition = $this->condition->compile($env); |
136 | 136 | } |
137 | 137 | |
138 | - return $this->createDerived( $elements, $extendList, $evaldCondition ); |
|
138 | + return $this->createDerived($elements, $extendList, $evaldCondition); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | /** |
143 | 143 | * @see Less_Tree::genCSS |
144 | 144 | */ |
145 | - public function genCSS( $output, $firstSelector = true ){ |
|
145 | + public function genCSS($output, $firstSelector = true) { |
|
146 | 146 | |
147 | - if( !$firstSelector && $this->elements[0]->combinator === "" ){ |
|
147 | + if (!$firstSelector && $this->elements[0]->combinator==="") { |
|
148 | 148 | $output->add(' ', $this->currentFileInfo, $this->index); |
149 | 149 | } |
150 | 150 | |
151 | - foreach($this->elements as $element){ |
|
152 | - $element->genCSS( $output ); |
|
151 | + foreach ($this->elements as $element) { |
|
152 | + $element->genCSS($output); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | - public function markReferenced(){ |
|
156 | + public function markReferenced() { |
|
157 | 157 | $this->isReferenced = true; |
158 | 158 | } |
159 | 159 | |
160 | - public function getIsReferenced(){ |
|
160 | + public function getIsReferenced() { |
|
161 | 161 | return !isset($this->currentFileInfo['reference']) || !$this->currentFileInfo['reference'] || $this->isReferenced; |
162 | 162 | } |
163 | 163 | |
164 | - public function getIsOutput(){ |
|
164 | + public function getIsOutput() { |
|
165 | 165 | return $this->evaldCondition; |
166 | 166 | } |
167 | 167 |
@@ -15,9 +15,9 @@ |
||
15 | 15 | $this->value = $value; |
16 | 16 | } |
17 | 17 | |
18 | - /** |
|
19 | - * @see Less_Tree::genCSS |
|
20 | - */ |
|
18 | + /** |
|
19 | + * @see Less_Tree::genCSS |
|
20 | + */ |
|
21 | 21 | public function genCSS( $output ){ |
22 | 22 | $output->add( $this->value ); |
23 | 23 | } |
@@ -6,23 +6,23 @@ |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_UnicodeDescriptor extends Less_Tree{ |
|
9 | +class Less_Tree_UnicodeDescriptor extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $value; |
12 | 12 | public $type = 'UnicodeDescriptor'; |
13 | 13 | |
14 | - public function __construct($value){ |
|
14 | + public function __construct($value) { |
|
15 | 15 | $this->value = $value; |
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @see Less_Tree::genCSS |
20 | 20 | */ |
21 | - public function genCSS( $output ){ |
|
22 | - $output->add( $this->value ); |
|
21 | + public function genCSS($output) { |
|
22 | + $output->add($this->value); |
|
23 | 23 | } |
24 | 24 | |
25 | - public function compile(){ |
|
25 | + public function compile() { |
|
26 | 26 | return $this; |
27 | 27 | } |
28 | 28 | } |
@@ -13,19 +13,19 @@ discard block |
||
13 | 13 | public $backupUnit; |
14 | 14 | public $type = 'Unit'; |
15 | 15 | |
16 | - public function __construct($numerator = array(), $denominator = array(), $backupUnit = null ){ |
|
16 | + public function __construct($numerator = array(), $denominator = array(), $backupUnit = null ){ |
|
17 | 17 | $this->numerator = $numerator; |
18 | 18 | $this->denominator = $denominator; |
19 | 19 | $this->backupUnit = $backupUnit; |
20 | 20 | } |
21 | 21 | |
22 | - public function __clone(){ |
|
22 | + public function __clone(){ |
|
23 | 23 | } |
24 | 24 | |
25 | - /** |
|
26 | - * @see Less_Tree::genCSS |
|
27 | - */ |
|
28 | - public function genCSS( $output ){ |
|
25 | + /** |
|
26 | + * @see Less_Tree::genCSS |
|
27 | + */ |
|
28 | + public function genCSS( $output ){ |
|
29 | 29 | |
30 | 30 | if( $this->numerator ){ |
31 | 31 | $output->add( $this->numerator[0] ); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | - public function toString(){ |
|
40 | + public function toString(){ |
|
41 | 41 | $returnStr = implode('*',$this->numerator); |
42 | 42 | foreach($this->denominator as $d){ |
43 | 43 | $returnStr .= '/'.$d; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | return $returnStr; |
46 | 46 | } |
47 | 47 | |
48 | - public function __toString(){ |
|
48 | + public function __toString(){ |
|
49 | 49 | return $this->toString(); |
50 | 50 | } |
51 | 51 | |
@@ -53,33 +53,33 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * @param Less_Tree_Unit $other |
55 | 55 | */ |
56 | - public function compare($other) { |
|
56 | + public function compare($other) { |
|
57 | 57 | return $this->is( $other->toString() ) ? 0 : -1; |
58 | 58 | } |
59 | 59 | |
60 | - public function is($unitString){ |
|
60 | + public function is($unitString){ |
|
61 | 61 | return $this->toString() === $unitString; |
62 | 62 | } |
63 | 63 | |
64 | - public function isLength(){ |
|
64 | + public function isLength(){ |
|
65 | 65 | $css = $this->toCSS(); |
66 | 66 | return !!preg_match('/px|em|%|in|cm|mm|pc|pt|ex/',$css); |
67 | 67 | } |
68 | 68 | |
69 | - public function isAngle() { |
|
69 | + public function isAngle() { |
|
70 | 70 | return isset( Less_Tree_UnitConversions::$angle[$this->toCSS()] ); |
71 | 71 | } |
72 | 72 | |
73 | - public function isEmpty(){ |
|
73 | + public function isEmpty(){ |
|
74 | 74 | return !$this->numerator && !$this->denominator; |
75 | 75 | } |
76 | 76 | |
77 | - public function isSingular() { |
|
77 | + public function isSingular() { |
|
78 | 78 | return count($this->numerator) <= 1 && !$this->denominator; |
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | - public function usedUnits(){ |
|
82 | + public function usedUnits(){ |
|
83 | 83 | $result = array(); |
84 | 84 | |
85 | 85 | foreach(Less_Tree_UnitConversions::$groups as $groupName){ |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | return $result; |
102 | 102 | } |
103 | 103 | |
104 | - public function cancel(){ |
|
104 | + public function cancel(){ |
|
105 | 105 | $counter = array(); |
106 | 106 | $backup = null; |
107 | 107 |
@@ -6,46 +6,46 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_Unit extends Less_Tree{ |
|
9 | +class Less_Tree_Unit extends Less_Tree { |
|
10 | 10 | |
11 | 11 | var $numerator = array(); |
12 | 12 | var $denominator = array(); |
13 | 13 | public $backupUnit; |
14 | 14 | public $type = 'Unit'; |
15 | 15 | |
16 | - public function __construct($numerator = array(), $denominator = array(), $backupUnit = null ){ |
|
16 | + public function __construct($numerator = array(), $denominator = array(), $backupUnit = null) { |
|
17 | 17 | $this->numerator = $numerator; |
18 | 18 | $this->denominator = $denominator; |
19 | 19 | $this->backupUnit = $backupUnit; |
20 | 20 | } |
21 | 21 | |
22 | - public function __clone(){ |
|
22 | + public function __clone() { |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @see Less_Tree::genCSS |
27 | 27 | */ |
28 | - public function genCSS( $output ){ |
|
29 | - |
|
30 | - if( $this->numerator ){ |
|
31 | - $output->add( $this->numerator[0] ); |
|
32 | - }elseif( $this->denominator ){ |
|
33 | - $output->add( $this->denominator[0] ); |
|
34 | - }elseif( !Less_Parser::$options['strictUnits'] && $this->backupUnit ){ |
|
35 | - $output->add( $this->backupUnit ); |
|
36 | - return ; |
|
28 | + public function genCSS($output) { |
|
29 | + |
|
30 | + if ($this->numerator) { |
|
31 | + $output->add($this->numerator[0]); |
|
32 | + }elseif ($this->denominator) { |
|
33 | + $output->add($this->denominator[0]); |
|
34 | + }elseif (!Less_Parser::$options['strictUnits'] && $this->backupUnit) { |
|
35 | + $output->add($this->backupUnit); |
|
36 | + return; |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | - public function toString(){ |
|
41 | - $returnStr = implode('*',$this->numerator); |
|
42 | - foreach($this->denominator as $d){ |
|
40 | + public function toString() { |
|
41 | + $returnStr = implode('*', $this->numerator); |
|
42 | + foreach ($this->denominator as $d) { |
|
43 | 43 | $returnStr .= '/'.$d; |
44 | 44 | } |
45 | 45 | return $returnStr; |
46 | 46 | } |
47 | 47 | |
48 | - public function __toString(){ |
|
48 | + public function __toString() { |
|
49 | 49 | return $this->toString(); |
50 | 50 | } |
51 | 51 | |
@@ -54,45 +54,45 @@ discard block |
||
54 | 54 | * @param Less_Tree_Unit $other |
55 | 55 | */ |
56 | 56 | public function compare($other) { |
57 | - return $this->is( $other->toString() ) ? 0 : -1; |
|
57 | + return $this->is($other->toString()) ? 0 : -1; |
|
58 | 58 | } |
59 | 59 | |
60 | - public function is($unitString){ |
|
61 | - return $this->toString() === $unitString; |
|
60 | + public function is($unitString) { |
|
61 | + return $this->toString()===$unitString; |
|
62 | 62 | } |
63 | 63 | |
64 | - public function isLength(){ |
|
64 | + public function isLength() { |
|
65 | 65 | $css = $this->toCSS(); |
66 | - return !!preg_match('/px|em|%|in|cm|mm|pc|pt|ex/',$css); |
|
66 | + return !!preg_match('/px|em|%|in|cm|mm|pc|pt|ex/', $css); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function isAngle() { |
70 | - return isset( Less_Tree_UnitConversions::$angle[$this->toCSS()] ); |
|
70 | + return isset(Less_Tree_UnitConversions::$angle[$this->toCSS()]); |
|
71 | 71 | } |
72 | 72 | |
73 | - public function isEmpty(){ |
|
73 | + public function isEmpty() { |
|
74 | 74 | return !$this->numerator && !$this->denominator; |
75 | 75 | } |
76 | 76 | |
77 | 77 | public function isSingular() { |
78 | - return count($this->numerator) <= 1 && !$this->denominator; |
|
78 | + return count($this->numerator)<=1 && !$this->denominator; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | - public function usedUnits(){ |
|
82 | + public function usedUnits() { |
|
83 | 83 | $result = array(); |
84 | 84 | |
85 | - foreach(Less_Tree_UnitConversions::$groups as $groupName){ |
|
85 | + foreach (Less_Tree_UnitConversions::$groups as $groupName) { |
|
86 | 86 | $group = Less_Tree_UnitConversions::${$groupName}; |
87 | 87 | |
88 | - foreach($this->numerator as $atomicUnit){ |
|
89 | - if( isset($group[$atomicUnit]) && !isset($result[$groupName]) ){ |
|
88 | + foreach ($this->numerator as $atomicUnit) { |
|
89 | + if (isset($group[$atomicUnit]) && !isset($result[$groupName])) { |
|
90 | 90 | $result[$groupName] = $atomicUnit; |
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - foreach($this->denominator as $atomicUnit){ |
|
95 | - if( isset($group[$atomicUnit]) && !isset($result[$groupName]) ){ |
|
94 | + foreach ($this->denominator as $atomicUnit) { |
|
95 | + if (isset($group[$atomicUnit]) && !isset($result[$groupName])) { |
|
96 | 96 | $result[$groupName] = $atomicUnit; |
97 | 97 | } |
98 | 98 | } |
@@ -101,40 +101,40 @@ discard block |
||
101 | 101 | return $result; |
102 | 102 | } |
103 | 103 | |
104 | - public function cancel(){ |
|
104 | + public function cancel() { |
|
105 | 105 | $counter = array(); |
106 | 106 | $backup = null; |
107 | 107 | |
108 | - foreach($this->numerator as $atomicUnit){ |
|
109 | - if( !$backup ){ |
|
108 | + foreach ($this->numerator as $atomicUnit) { |
|
109 | + if (!$backup) { |
|
110 | 110 | $backup = $atomicUnit; |
111 | 111 | } |
112 | - $counter[$atomicUnit] = ( isset($counter[$atomicUnit]) ? $counter[$atomicUnit] : 0) + 1; |
|
112 | + $counter[$atomicUnit] = (isset($counter[$atomicUnit]) ? $counter[$atomicUnit] : 0)+1; |
|
113 | 113 | } |
114 | 114 | |
115 | - foreach($this->denominator as $atomicUnit){ |
|
116 | - if( !$backup ){ |
|
115 | + foreach ($this->denominator as $atomicUnit) { |
|
116 | + if (!$backup) { |
|
117 | 117 | $backup = $atomicUnit; |
118 | 118 | } |
119 | - $counter[$atomicUnit] = ( isset($counter[$atomicUnit]) ? $counter[$atomicUnit] : 0) - 1; |
|
119 | + $counter[$atomicUnit] = (isset($counter[$atomicUnit]) ? $counter[$atomicUnit] : 0)-1; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $this->numerator = array(); |
123 | 123 | $this->denominator = array(); |
124 | 124 | |
125 | - foreach($counter as $atomicUnit => $count){ |
|
126 | - if( $count > 0 ){ |
|
127 | - for( $i = 0; $i < $count; $i++ ){ |
|
125 | + foreach ($counter as $atomicUnit => $count) { |
|
126 | + if ($count>0) { |
|
127 | + for ($i = 0; $i<$count; $i++) { |
|
128 | 128 | $this->numerator[] = $atomicUnit; |
129 | 129 | } |
130 | - }elseif( $count < 0 ){ |
|
131 | - for( $i = 0; $i < -$count; $i++ ){ |
|
130 | + }elseif ($count<0) { |
|
131 | + for ($i = 0; $i<-$count; $i++) { |
|
132 | 132 | $this->denominator[] = $atomicUnit; |
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | - if( !$this->numerator && !$this->denominator && $backup ){ |
|
137 | + if (!$this->numerator && !$this->denominator && $backup) { |
|
138 | 138 | $this->backupUnit = $backup; |
139 | 139 | } |
140 | 140 |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | |
30 | 30 | if( $this->numerator ){ |
31 | 31 | $output->add( $this->numerator[0] ); |
32 | - }elseif( $this->denominator ){ |
|
32 | + } elseif( $this->denominator ){ |
|
33 | 33 | $output->add( $this->denominator[0] ); |
34 | - }elseif( !Less_Parser::$options['strictUnits'] && $this->backupUnit ){ |
|
34 | + } elseif( !Less_Parser::$options['strictUnits'] && $this->backupUnit ){ |
|
35 | 35 | $output->add( $this->backupUnit ); |
36 | 36 | return ; |
37 | 37 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | for( $i = 0; $i < $count; $i++ ){ |
128 | 128 | $this->numerator[] = $atomicUnit; |
129 | 129 | } |
130 | - }elseif( $count < 0 ){ |
|
130 | + } elseif( $count < 0 ){ |
|
131 | 131 | for( $i = 0; $i < -$count; $i++ ){ |
132 | 132 | $this->denominator[] = $atomicUnit; |
133 | 133 | } |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_UnitConversions{ |
|
9 | +class Less_Tree_UnitConversions { |
|
10 | 10 | |
11 | - public static $groups = array('length','duration','angle'); |
|
11 | + public static $groups = array('length', 'duration', 'angle'); |
|
12 | 12 | |
13 | 13 | public static $length = array( |
14 | 14 | 'm'=> 1, |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | ); |
27 | 27 | |
28 | 28 | public static $angle = array( |
29 | - 'rad' => 0.1591549430919, // 1/(2*M_PI), |
|
30 | - 'deg' => 0.002777778, // 1/360, |
|
31 | - 'grad'=> 0.0025, // 1/400, |
|
29 | + 'rad' => 0.1591549430919, // 1/(2*M_PI), |
|
30 | + 'deg' => 0.002777778, // 1/360, |
|
31 | + 'grad'=> 0.0025, // 1/400, |
|
32 | 32 | 'turn'=> 1 |
33 | 33 | ); |
34 | 34 |
@@ -20,14 +20,14 @@ |
||
20 | 20 | $this->isEvald = $isEvald; |
21 | 21 | } |
22 | 22 | |
23 | - public function accept( $visitor ){ |
|
23 | + public function accept( $visitor ){ |
|
24 | 24 | $this->value = $visitor->visitObj($this->value); |
25 | 25 | } |
26 | 26 | |
27 | - /** |
|
28 | - * @see Less_Tree::genCSS |
|
29 | - */ |
|
30 | - public function genCSS( $output ){ |
|
27 | + /** |
|
28 | + * @see Less_Tree::genCSS |
|
29 | + */ |
|
30 | + public function genCSS( $output ){ |
|
31 | 31 | $output->add( 'url(' ); |
32 | 32 | $this->value->genCSS( $output ); |
33 | 33 | $output->add( ')' ); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_Url extends Less_Tree{ |
|
9 | +class Less_Tree_Url extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $attrs; |
12 | 12 | public $value; |
@@ -14,57 +14,57 @@ discard block |
||
14 | 14 | public $isEvald; |
15 | 15 | public $type = 'Url'; |
16 | 16 | |
17 | - public function __construct($value, $currentFileInfo = null, $isEvald = null){ |
|
17 | + public function __construct($value, $currentFileInfo = null, $isEvald = null) { |
|
18 | 18 | $this->value = $value; |
19 | 19 | $this->currentFileInfo = $currentFileInfo; |
20 | 20 | $this->isEvald = $isEvald; |
21 | 21 | } |
22 | 22 | |
23 | - public function accept( $visitor ){ |
|
23 | + public function accept($visitor) { |
|
24 | 24 | $this->value = $visitor->visitObj($this->value); |
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @see Less_Tree::genCSS |
29 | 29 | */ |
30 | - public function genCSS( $output ){ |
|
31 | - $output->add( 'url(' ); |
|
32 | - $this->value->genCSS( $output ); |
|
33 | - $output->add( ')' ); |
|
30 | + public function genCSS($output) { |
|
31 | + $output->add('url('); |
|
32 | + $this->value->genCSS($output); |
|
33 | + $output->add(')'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @param Less_Functions $ctx |
38 | 38 | */ |
39 | - public function compile($ctx){ |
|
39 | + public function compile($ctx) { |
|
40 | 40 | $val = $this->value->compile($ctx); |
41 | 41 | |
42 | - if( !$this->isEvald ){ |
|
42 | + if (!$this->isEvald) { |
|
43 | 43 | // Add the base path if the URL is relative |
44 | - if( Less_Parser::$options['relativeUrls'] |
|
44 | + if (Less_Parser::$options['relativeUrls'] |
|
45 | 45 | && $this->currentFileInfo |
46 | 46 | && is_string($val->value) |
47 | 47 | && Less_Environment::isPathRelative($val->value) |
48 | - ){ |
|
48 | + ) { |
|
49 | 49 | $rootpath = $this->currentFileInfo['uri_root']; |
50 | - if ( !$val->quote ){ |
|
51 | - $rootpath = preg_replace('/[\(\)\'"\s]/', '\\$1', $rootpath ); |
|
50 | + if (!$val->quote) { |
|
51 | + $rootpath = preg_replace('/[\(\)\'"\s]/', '\\$1', $rootpath); |
|
52 | 52 | } |
53 | - $val->value = $rootpath . $val->value; |
|
53 | + $val->value = $rootpath.$val->value; |
|
54 | 54 | } |
55 | 55 | |
56 | - $val->value = Less_Environment::normalizePath( $val->value); |
|
56 | + $val->value = Less_Environment::normalizePath($val->value); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Add cache buster if enabled |
60 | - if( Less_Parser::$options['urlArgs'] ){ |
|
61 | - if( !preg_match('/^\s*data:/',$val->value) ){ |
|
62 | - $delimiter = strpos($val->value,'?') === false ? '?' : '&'; |
|
63 | - $urlArgs = $delimiter . Less_Parser::$options['urlArgs']; |
|
64 | - $hash_pos = strpos($val->value,'#'); |
|
65 | - if( $hash_pos !== false ){ |
|
66 | - $val->value = substr_replace($val->value,$urlArgs, $hash_pos, 0); |
|
67 | - } else { |
|
60 | + if (Less_Parser::$options['urlArgs']) { |
|
61 | + if (!preg_match('/^\s*data:/', $val->value)) { |
|
62 | + $delimiter = strpos($val->value, '?')===false ? '?' : '&'; |
|
63 | + $urlArgs = $delimiter.Less_Parser::$options['urlArgs']; |
|
64 | + $hash_pos = strpos($val->value, '#'); |
|
65 | + if ($hash_pos!==false) { |
|
66 | + $val->value = substr_replace($val->value, $urlArgs, $hash_pos, 0); |
|
67 | + }else { |
|
68 | 68 | $val->value .= $urlArgs; |
69 | 69 | } |
70 | 70 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $this->value = $value; |
16 | 16 | } |
17 | 17 | |
18 | - public function accept($visitor) { |
|
18 | + public function accept($visitor) { |
|
19 | 19 | $this->value = $visitor->visitArray($this->value); |
20 | 20 | } |
21 | 21 | |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | return $ret[0]; |
33 | 33 | } |
34 | 34 | |
35 | - /** |
|
36 | - * @see Less_Tree::genCSS |
|
37 | - */ |
|
35 | + /** |
|
36 | + * @see Less_Tree::genCSS |
|
37 | + */ |
|
38 | 38 | function genCSS( $output ){ |
39 | 39 | $len = count($this->value); |
40 | 40 | for($i = 0; $i < $len; $i++ ){ |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_Value extends Less_Tree{ |
|
9 | +class Less_Tree_Value extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $type = 'Value'; |
12 | 12 | public $value; |
13 | 13 | |
14 | - public function __construct($value){ |
|
14 | + public function __construct($value) { |
|
15 | 15 | $this->value = $value; |
16 | 16 | } |
17 | 17 | |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | $this->value = $visitor->visitArray($this->value); |
20 | 20 | } |
21 | 21 | |
22 | - public function compile($env){ |
|
22 | + public function compile($env) { |
|
23 | 23 | |
24 | 24 | $ret = array(); |
25 | 25 | $i = 0; |
26 | - foreach($this->value as $i => $v){ |
|
26 | + foreach ($this->value as $i => $v) { |
|
27 | 27 | $ret[] = $v->compile($env); |
28 | 28 | } |
29 | - if( $i > 0 ){ |
|
29 | + if ($i>0) { |
|
30 | 30 | return new Less_Tree_Value($ret); |
31 | 31 | } |
32 | 32 | return $ret[0]; |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @see Less_Tree::genCSS |
37 | 37 | */ |
38 | - function genCSS( $output ){ |
|
38 | + function genCSS($output) { |
|
39 | 39 | $len = count($this->value); |
40 | - for($i = 0; $i < $len; $i++ ){ |
|
41 | - $this->value[$i]->genCSS( $output ); |
|
42 | - if( $i+1 < $len ){ |
|
43 | - $output->add( Less_Environment::$_outputMap[','] ); |
|
40 | + for ($i = 0; $i<$len; $i++) { |
|
41 | + $this->value[$i]->genCSS($output); |
|
42 | + if ($i+1<$len) { |
|
43 | + $output->add(Less_Environment::$_outputMap[',']); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
@@ -14,14 +14,14 @@ |
||
14 | 14 | public $evaluating = false; |
15 | 15 | public $type = 'Variable'; |
16 | 16 | |
17 | - /** |
|
18 | - * @param string $name |
|
19 | - */ |
|
20 | - public function __construct($name, $index = null, $currentFileInfo = null) { |
|
21 | - $this->name = $name; |
|
22 | - $this->index = $index; |
|
17 | + /** |
|
18 | + * @param string $name |
|
19 | + */ |
|
20 | + public function __construct($name, $index = null, $currentFileInfo = null) { |
|
21 | + $this->name = $name; |
|
22 | + $this->index = $index; |
|
23 | 23 | $this->currentFileInfo = $currentFileInfo; |
24 | - } |
|
24 | + } |
|
25 | 25 | |
26 | 26 | public function compile($env) { |
27 | 27 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Less |
7 | 7 | * @subpackage tree |
8 | 8 | */ |
9 | -class Less_Tree_Variable extends Less_Tree{ |
|
9 | +class Less_Tree_Variable extends Less_Tree { |
|
10 | 10 | |
11 | 11 | public $name; |
12 | 12 | public $index; |
@@ -25,28 +25,28 @@ discard block |
||
25 | 25 | |
26 | 26 | public function compile($env) { |
27 | 27 | |
28 | - if( $this->name[1] === '@' ){ |
|
29 | - $v = new Less_Tree_Variable(substr($this->name, 1), $this->index + 1, $this->currentFileInfo); |
|
30 | - $name = '@' . $v->compile($env)->value; |
|
31 | - }else{ |
|
28 | + if ($this->name[1]==='@') { |
|
29 | + $v = new Less_Tree_Variable(substr($this->name, 1), $this->index+1, $this->currentFileInfo); |
|
30 | + $name = '@'.$v->compile($env)->value; |
|
31 | + }else { |
|
32 | 32 | $name = $this->name; |
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($this->evaluating) { |
36 | - throw new Less_Exception_Compiler("Recursive variable definition for " . $name, null, $this->index, $this->currentFileInfo); |
|
36 | + throw new Less_Exception_Compiler("Recursive variable definition for ".$name, null, $this->index, $this->currentFileInfo); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | $this->evaluating = true; |
40 | 40 | |
41 | - foreach($env->frames as $frame){ |
|
42 | - if( $v = $frame->variable($name) ){ |
|
41 | + foreach ($env->frames as $frame) { |
|
42 | + if ($v = $frame->variable($name)) { |
|
43 | 43 | $r = $v->value->compile($env); |
44 | 44 | $this->evaluating = false; |
45 | 45 | return $r; |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | - throw new Less_Exception_Compiler("variable " . $name . " is undefined in file ".$this->currentFileInfo["filename"], null, $this->index ); |
|
49 | + throw new Less_Exception_Compiler("variable ".$name." is undefined in file ".$this->currentFileInfo["filename"], null, $this->index); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $this->$funcName( $node ); |
34 | 34 | } |
35 | 35 | |
36 | - }else{ |
|
36 | + } else{ |
|
37 | 37 | $node->accept($this); |
38 | 38 | } |
39 | 39 |