@@ -87,12 +87,12 @@ public function add($node)
8787 $ this ->addNodeList ($ node );
8888 } elseif ($ node instanceof \DOMNode) {
8989 $ this ->addNode ($ node );
90- } elseif (is_array ($ node )) {
90+ } elseif (\ is_array ($ node )) {
9191 $ this ->addNodes ($ node );
92- } elseif (is_string ($ node )) {
92+ } elseif (\ is_string ($ node )) {
9393 $ this ->addContent ($ node );
9494 } elseif (null !== $ node ) {
95- throw new \InvalidArgumentException (sprintf ('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s". ' , is_object ($ node ) ? get_class ($ node ) : gettype ($ node )));
95+ throw new \InvalidArgumentException (sprintf ('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s". ' , \ is_object ($ node ) ? \ get_class ($ node ) : \ gettype ($ node )));
9696 }
9797 }
9898
@@ -186,7 +186,7 @@ public function addHtmlContent($content, $charset = 'UTF-8')
186186 $ base = $ this ->filterRelativeXPath ('descendant-or-self::base ' )->extract (array ('href ' ));
187187
188188 $ baseHref = current ($ base );
189- if (count ($ base ) && !empty ($ baseHref )) {
189+ if (\ count ($ base ) && !empty ($ baseHref )) {
190190 if ($ this ->baseHref ) {
191191 $ linkNode = $ dom ->createElement ('a ' );
192192 $ linkNode ->setAttribute ('href ' , $ baseHref );
@@ -405,7 +405,7 @@ public function first()
405405 */
406406 public function last ()
407407 {
408- return $ this ->eq (count ($ this ) - 1 );
408+ return $ this ->eq (\ count ($ this ) - 1 );
409409 }
410410
411411 /**
@@ -417,7 +417,7 @@ public function last()
417417 */
418418 public function siblings ()
419419 {
420- if (!count ($ this )) {
420+ if (!\ count ($ this )) {
421421 throw new \InvalidArgumentException ('The current node list is empty. ' );
422422 }
423423
@@ -433,7 +433,7 @@ public function siblings()
433433 */
434434 public function nextAll ()
435435 {
436- if (!count ($ this )) {
436+ if (!\ count ($ this )) {
437437 throw new \InvalidArgumentException ('The current node list is empty. ' );
438438 }
439439
@@ -449,7 +449,7 @@ public function nextAll()
449449 */
450450 public function previousAll ()
451451 {
452- if (!count ($ this )) {
452+ if (!\ count ($ this )) {
453453 throw new \InvalidArgumentException ('The current node list is empty. ' );
454454 }
455455
@@ -465,7 +465,7 @@ public function previousAll()
465465 */
466466 public function parents ()
467467 {
468- if (!count ($ this )) {
468+ if (!\ count ($ this )) {
469469 throw new \InvalidArgumentException ('The current node list is empty. ' );
470470 }
471471
@@ -490,7 +490,7 @@ public function parents()
490490 */
491491 public function children ()
492492 {
493- if (!count ($ this )) {
493+ if (!\ count ($ this )) {
494494 throw new \InvalidArgumentException ('The current node list is empty. ' );
495495 }
496496
@@ -510,7 +510,7 @@ public function children()
510510 */
511511 public function attr ($ attribute )
512512 {
513- if (!count ($ this )) {
513+ if (!\ count ($ this )) {
514514 throw new \InvalidArgumentException ('The current node list is empty. ' );
515515 }
516516
@@ -528,7 +528,7 @@ public function attr($attribute)
528528 */
529529 public function nodeName ()
530530 {
531- if (!count ($ this )) {
531+ if (!\ count ($ this )) {
532532 throw new \InvalidArgumentException ('The current node list is empty. ' );
533533 }
534534
@@ -544,7 +544,7 @@ public function nodeName()
544544 */
545545 public function text ()
546546 {
547- if (!count ($ this )) {
547+ if (!\ count ($ this )) {
548548 throw new \InvalidArgumentException ('The current node list is empty. ' );
549549 }
550550
@@ -560,7 +560,7 @@ public function text()
560560 */
561561 public function html ()
562562 {
563- if (!count ($ this )) {
563+ if (!\ count ($ this )) {
564564 throw new \InvalidArgumentException ('The current node list is empty. ' );
565565 }
566566
@@ -588,7 +588,7 @@ public function html()
588588 public function extract ($ attributes )
589589 {
590590 $ attributes = (array ) $ attributes ;
591- $ count = count ($ attributes );
591+ $ count = \ count ($ attributes );
592592
593593 $ data = array ();
594594 foreach ($ this as $ node ) {
@@ -697,14 +697,14 @@ public function selectButton($value)
697697 */
698698 public function link ($ method = 'get ' )
699699 {
700- if (!count ($ this )) {
700+ if (!\ count ($ this )) {
701701 throw new \InvalidArgumentException ('The current node list is empty. ' );
702702 }
703703
704704 $ node = $ this ->getNode (0 );
705705
706706 if (!$ node instanceof \DOMElement) {
707- throw new \InvalidArgumentException (sprintf ('The selected node should be instance of DOMElement, got "%s". ' , get_class ($ node )));
707+ throw new \InvalidArgumentException (sprintf ('The selected node should be instance of DOMElement, got "%s". ' , \ get_class ($ node )));
708708 }
709709
710710 return new Link ($ node , $ this ->baseHref , $ method );
@@ -722,7 +722,7 @@ public function links()
722722 $ links = array ();
723723 foreach ($ this as $ node ) {
724724 if (!$ node instanceof \DOMElement) {
725- throw new \InvalidArgumentException (sprintf ('The current node list should contain only DOMElement instances, "%s" found. ' , get_class ($ node )));
725+ throw new \InvalidArgumentException (sprintf ('The current node list should contain only DOMElement instances, "%s" found. ' , \ get_class ($ node )));
726726 }
727727
728728 $ links [] = new Link ($ node , $ this ->baseHref , 'get ' );
@@ -743,14 +743,14 @@ public function links()
743743 */
744744 public function form (array $ values = null , $ method = null )
745745 {
746- if (!count ($ this )) {
746+ if (!\ count ($ this )) {
747747 throw new \InvalidArgumentException ('The current node list is empty. ' );
748748 }
749749
750750 $ node = $ this ->getNode (0 );
751751
752752 if (!$ node instanceof \DOMElement) {
753- throw new \InvalidArgumentException (sprintf ('The selected node should be instance of DOMElement, got "%s". ' , get_class ($ node )));
753+ throw new \InvalidArgumentException (sprintf ('The selected node should be instance of DOMElement, got "%s". ' , \ get_class ($ node )));
754754 }
755755
756756 $ form = new Form ($ node , $ this ->uri , $ method , $ this ->baseHref );
@@ -989,7 +989,7 @@ private function relativize($xpath)
989989 // We cannot simply drop
990990 $ nonMatchingExpression = 'a[name() = "b"] ' ;
991991
992- $ xpathLen = strlen ($ xpath );
992+ $ xpathLen = \ strlen ($ xpath );
993993 $ openedBrackets = 0 ;
994994 $ startPosition = strspn ($ xpath , " \t\n\r\0\x0B" );
995995
@@ -1185,7 +1185,7 @@ private function createSubCrawler($nodes)
11851185
11861186 private function triggerDeprecation ($ methodName , $ useTrace = false )
11871187 {
1188- if ($ useTrace || defined ('HHVM_VERSION ' )) {
1188+ if ($ useTrace || \ defined ('HHVM_VERSION ' )) {
11891189 if (\PHP_VERSION_ID >= 50400 ) {
11901190 $ trace = debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS , 3 );
11911191 } else {
0 commit comments