@@ -107,7 +107,7 @@ protected function parseSelector($stream)
107107
108108 while (1 ) {
109109 $ peek = $ stream ->peek ();
110- if ($ peek == ' , ' || null === $ peek ) {
110+ if (' , ' == $ peek || null === $ peek ) {
111111 return $ result ;
112112 } elseif (in_array ($ peek , array ('+ ' , '> ' , '~ ' ))) {
113113 // A combinator
@@ -133,19 +133,19 @@ protected function parseSelector($stream)
133133 protected function parseSimpleSelector ($ stream )
134134 {
135135 $ peek = $ stream ->peek ();
136- if ($ peek != ' * ' && !$ peek ->isType ('Symbol ' )) {
136+ if (' * ' != $ peek && !$ peek ->isType ('Symbol ' )) {
137137 $ element = $ namespace = '* ' ;
138138 } else {
139139 $ next = $ stream ->next ();
140- if ($ next != ' * ' && !$ next ->isType ('Symbol ' )) {
140+ if (' * ' != $ next && !$ next ->isType ('Symbol ' )) {
141141 throw new SyntaxError (sprintf ("Expected symbol, got '%s' " , $ next ));
142142 }
143143
144144 if ($ stream ->peek () == '| ' ) {
145145 $ namespace = $ next ;
146146 $ stream ->next ();
147147 $ element = $ stream ->next ();
148- if ($ element != ' * ' && !$ next ->isType ('Symbol ' )) {
148+ if (' * ' != $ element && !$ next ->isType ('Symbol ' )) {
149149 throw new SyntaxError (sprintf ("Expected symbol, got '%s' " , $ next ));
150150 }
151151 } else {
@@ -158,7 +158,7 @@ protected function parseSimpleSelector($stream)
158158 $ has_hash = false ;
159159 while (1 ) {
160160 $ peek = $ stream ->peek ();
161- if ($ peek == ' # ' ) {
161+ if (' # ' == $ peek ) {
162162 if ($ has_hash ) {
163163 /* You can't have two hashes
164164 (FIXME: is there some more general rule I'm missing?) */
@@ -171,21 +171,21 @@ protected function parseSimpleSelector($stream)
171171 $ has_hash = true ;
172172
173173 continue ;
174- } elseif ($ peek == ' . ' ) {
174+ } elseif (' . ' == $ peek ) {
175175 $ stream ->next ();
176176 $ result = new Node \ClassNode ($ result , $ stream ->next ());
177177
178178 continue ;
179- } elseif ($ peek == ' [ ' ) {
179+ } elseif (' [ ' == $ peek ) {
180180 $ stream ->next ();
181181 $ result = $ this ->parseAttrib ($ result , $ stream );
182182 $ next = $ stream ->next ();
183- if ($ next != ' ] ' ) {
183+ if (' ] ' != $ next ) {
184184 throw new SyntaxError (sprintf ("] expected, got '%s' " , $ next ));
185185 }
186186
187187 continue ;
188- } elseif ($ peek == ': ' || $ peek == ':: ' ) {
188+ } elseif (': ' == $ peek || ':: ' == $ peek ) {
189189 $ type = $ stream ->next ();
190190 $ ident = $ stream ->next ();
191191 if (!$ ident || !$ ident ->isType ('Symbol ' )) {
@@ -204,7 +204,7 @@ protected function parseSimpleSelector($stream)
204204 $ selector = $ this ->parseSimpleSelector ($ stream );
205205 }
206206 $ next = $ stream ->next ();
207- if ($ next != ' ) ' ) {
207+ if (' ) ' != $ next ) {
208208 throw new SyntaxError (sprintf ("Expected ')', got '%s' and '%s' " , $ next , $ selector ));
209209 }
210210
@@ -215,7 +215,7 @@ protected function parseSimpleSelector($stream)
215215
216216 continue ;
217217 } else {
218- if ($ peek == ' ' ) {
218+ if (' ' == $ peek ) {
219219 $ stream ->next ();
220220 }
221221
0 commit comments