@@ -65,15 +65,15 @@ public function offsetGet($offset)
6565 */
6666 public function offsetSet ($ offset , $ value )
6767 {
68- trigger_error ('offsetSet not implemented ' , E_USER_WARNING );
68+ \ trigger_error ('offsetSet not implemented ' , E_USER_WARNING );
6969 }
7070
7171 /**
7272 * @param mixed $offset
7373 */
7474 public function offsetUnset ($ offset )
7575 {
76- trigger_error ('offsetUnset not implemented ' , E_USER_WARNING );
76+ \ trigger_error ('offsetUnset not implemented ' , E_USER_WARNING );
7777 }
7878
7979 /**
@@ -121,7 +121,7 @@ public function next()
121121 */
122122 public function valid ()
123123 {
124- return $ this ->counter < $ this ->nodeList ->length ;
124+ return $ this ->nodeList && $ this -> counter < $ this ->nodeList ->length ;
125125 }
126126
127127 /**
@@ -163,6 +163,7 @@ public function map($c)
163163
164164
165165 //math methods
166+
166167 /**
167168 * @param $nl
168169 * @param string $op
@@ -185,13 +186,13 @@ public function doMath($nl, $op = 'plus')
185186 switch ($ op )
186187 {
187188 case 'plus ' :
188- $ new_paths = array_unique (array_merge ($ paths , $ other_paths ));
189+ $ new_paths = \ array_unique (\ array_merge ($ paths , $ other_paths ));
189190 break ;
190191 case 'minus ' :
191- $ new_paths = array_diff ($ paths , $ other_paths );
192+ $ new_paths = \ array_diff ($ paths , $ other_paths );
192193 break ;
193194 case 'intersect ' :
194- $ new_paths = array_intersect ($ paths , $ other_paths );
195+ $ new_paths = \ array_intersect ($ paths , $ other_paths );
195196 break ;
196197 }
197198
@@ -230,6 +231,7 @@ public function intersect($nl)
230231
231232
232233 // magic methods
234+
233235 /**
234236 * @param $key
235237 * @param $values
@@ -238,7 +240,7 @@ public function intersect($nl)
238240 */
239241 public function __call ($ key , $ values )
240242 {
241- $ key = strtolower (str_replace ('_ ' , '' , $ key ));
243+ $ key = \ strtolower (\ str_replace ('_ ' , '' , $ key ));
242244 switch ($ key )
243245 {
244246 case 'to_a ' :
@@ -259,7 +261,7 @@ public function __call($key, $values)
259261 if(preg_match(TAG_REGEX, $key, $m)) return $this->find($m[1], 0);
260262 */
261263
262- if (preg_match (ATTRIBUTES_REGEX , $ key , $ m ) || preg_match ('/^((clean|trim|str).*)s$/ ' , $ key , $ m ))
264+ if (\ preg_match (ATTRIBUTES_REGEX , $ key , $ m ) || \ preg_match ('/^((clean|trim|str).*)s$/ ' , $ key , $ m ))
263265 {
264266 foreach ($ this as $ node )
265267 {
@@ -270,15 +272,15 @@ public function __call($key, $values)
270272 return $ retval ;
271273 }
272274
273- if (preg_match (ATTRIBUTE_REGEX , $ key , $ m ))
275+ if (\ preg_match (ATTRIBUTE_REGEX , $ key , $ m ))
274276 {
275277 foreach ($ this as $ node )
276278 {
277279 $ arg = $ m [1 ];
278280 $ retval [] = $ node ->$ arg ;
279281 }
280282
281- return implode ('' , $ retval );
283+ return \ implode ('' , $ retval );
282284 }
283285
284286 // what now?
@@ -287,7 +289,7 @@ public function __call($key, $values)
287289 $ retval [] = isset ($ values [0 ]) ? $ node ->$ key ($ values [0 ]) : $ node ->$ key ();
288290 }
289291
290- return implode ('' , $ retval );
292+ return \ implode ('' , $ retval );
291293 }
292294
293295 /**
0 commit comments