@@ -87,12 +87,12 @@ public function add($node)
87
87
$ this ->addNodeList ($ node );
88
88
} elseif ($ node instanceof \DOMNode) {
89
89
$ this ->addNode ($ node );
90
- } elseif (is_array ($ node )) {
90
+ } elseif (\ is_array ($ node )) {
91
91
$ this ->addNodes ($ node );
92
- } elseif (is_string ($ node )) {
92
+ } elseif (\ is_string ($ node )) {
93
93
$ this ->addContent ($ node );
94
94
} 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 )));
96
96
}
97
97
}
98
98
@@ -186,7 +186,7 @@ public function addHtmlContent($content, $charset = 'UTF-8')
186
186
$ base = $ this ->filterRelativeXPath ('descendant-or-self::base ' )->extract (array ('href ' ));
187
187
188
188
$ baseHref = current ($ base );
189
- if (count ($ base ) && !empty ($ baseHref )) {
189
+ if (\ count ($ base ) && !empty ($ baseHref )) {
190
190
if ($ this ->baseHref ) {
191
191
$ linkNode = $ dom ->createElement ('a ' );
192
192
$ linkNode ->setAttribute ('href ' , $ baseHref );
@@ -405,7 +405,7 @@ public function first()
405
405
*/
406
406
public function last ()
407
407
{
408
- return $ this ->eq (count ($ this ) - 1 );
408
+ return $ this ->eq (\ count ($ this ) - 1 );
409
409
}
410
410
411
411
/**
@@ -417,7 +417,7 @@ public function last()
417
417
*/
418
418
public function siblings ()
419
419
{
420
- if (!count ($ this )) {
420
+ if (!\ count ($ this )) {
421
421
throw new \InvalidArgumentException ('The current node list is empty. ' );
422
422
}
423
423
@@ -433,7 +433,7 @@ public function siblings()
433
433
*/
434
434
public function nextAll ()
435
435
{
436
- if (!count ($ this )) {
436
+ if (!\ count ($ this )) {
437
437
throw new \InvalidArgumentException ('The current node list is empty. ' );
438
438
}
439
439
@@ -449,7 +449,7 @@ public function nextAll()
449
449
*/
450
450
public function previousAll ()
451
451
{
452
- if (!count ($ this )) {
452
+ if (!\ count ($ this )) {
453
453
throw new \InvalidArgumentException ('The current node list is empty. ' );
454
454
}
455
455
@@ -465,7 +465,7 @@ public function previousAll()
465
465
*/
466
466
public function parents ()
467
467
{
468
- if (!count ($ this )) {
468
+ if (!\ count ($ this )) {
469
469
throw new \InvalidArgumentException ('The current node list is empty. ' );
470
470
}
471
471
@@ -490,7 +490,7 @@ public function parents()
490
490
*/
491
491
public function children ()
492
492
{
493
- if (!count ($ this )) {
493
+ if (!\ count ($ this )) {
494
494
throw new \InvalidArgumentException ('The current node list is empty. ' );
495
495
}
496
496
@@ -510,7 +510,7 @@ public function children()
510
510
*/
511
511
public function attr ($ attribute )
512
512
{
513
- if (!count ($ this )) {
513
+ if (!\ count ($ this )) {
514
514
throw new \InvalidArgumentException ('The current node list is empty. ' );
515
515
}
516
516
@@ -528,7 +528,7 @@ public function attr($attribute)
528
528
*/
529
529
public function nodeName ()
530
530
{
531
- if (!count ($ this )) {
531
+ if (!\ count ($ this )) {
532
532
throw new \InvalidArgumentException ('The current node list is empty. ' );
533
533
}
534
534
@@ -544,7 +544,7 @@ public function nodeName()
544
544
*/
545
545
public function text ()
546
546
{
547
- if (!count ($ this )) {
547
+ if (!\ count ($ this )) {
548
548
throw new \InvalidArgumentException ('The current node list is empty. ' );
549
549
}
550
550
@@ -560,7 +560,7 @@ public function text()
560
560
*/
561
561
public function html ()
562
562
{
563
- if (!count ($ this )) {
563
+ if (!\ count ($ this )) {
564
564
throw new \InvalidArgumentException ('The current node list is empty. ' );
565
565
}
566
566
@@ -588,7 +588,7 @@ public function html()
588
588
public function extract ($ attributes )
589
589
{
590
590
$ attributes = (array ) $ attributes ;
591
- $ count = count ($ attributes );
591
+ $ count = \ count ($ attributes );
592
592
593
593
$ data = array ();
594
594
foreach ($ this as $ node ) {
@@ -697,14 +697,14 @@ public function selectButton($value)
697
697
*/
698
698
public function link ($ method = 'get ' )
699
699
{
700
- if (!count ($ this )) {
700
+ if (!\ count ($ this )) {
701
701
throw new \InvalidArgumentException ('The current node list is empty. ' );
702
702
}
703
703
704
704
$ node = $ this ->getNode (0 );
705
705
706
706
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 )));
708
708
}
709
709
710
710
return new Link ($ node , $ this ->baseHref , $ method );
@@ -722,7 +722,7 @@ public function links()
722
722
$ links = array ();
723
723
foreach ($ this as $ node ) {
724
724
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 )));
726
726
}
727
727
728
728
$ links [] = new Link ($ node , $ this ->baseHref , 'get ' );
@@ -743,14 +743,14 @@ public function links()
743
743
*/
744
744
public function form (array $ values = null , $ method = null )
745
745
{
746
- if (!count ($ this )) {
746
+ if (!\ count ($ this )) {
747
747
throw new \InvalidArgumentException ('The current node list is empty. ' );
748
748
}
749
749
750
750
$ node = $ this ->getNode (0 );
751
751
752
752
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 )));
754
754
}
755
755
756
756
$ form = new Form ($ node , $ this ->uri , $ method , $ this ->baseHref );
@@ -989,7 +989,7 @@ private function relativize($xpath)
989
989
// We cannot simply drop
990
990
$ nonMatchingExpression = 'a[name() = "b"] ' ;
991
991
992
- $ xpathLen = strlen ($ xpath );
992
+ $ xpathLen = \ strlen ($ xpath );
993
993
$ openedBrackets = 0 ;
994
994
$ startPosition = strspn ($ xpath , " \t\n\r\0\x0B" );
995
995
@@ -1185,7 +1185,7 @@ private function createSubCrawler($nodes)
1185
1185
1186
1186
private function triggerDeprecation ($ methodName , $ useTrace = false )
1187
1187
{
1188
- if ($ useTrace || defined ('HHVM_VERSION ' )) {
1188
+ if ($ useTrace || \ defined ('HHVM_VERSION ' )) {
1189
1189
if (\PHP_VERSION_ID >= 50400 ) {
1190
1190
$ trace = debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS , 3 );
1191
1191
} else {
0 commit comments