1414namespace QueryPath ;
1515
1616use \QueryPath \CSS \QueryPathEventHandler ;
17+ use \QueryPath ;
1718
1819
1920/**
@@ -764,7 +765,7 @@ public function is($selector) {
764765 */
765766 public function filter ($ selector ) {
766767 $ found = new \SplObjectStorage ();
767- foreach ($ this ->matches as $ m ) if (qp ($ m , NULL , $ this ->options )->is ($ selector )) $ found ->attach ($ m );
768+ foreach ($ this ->matches as $ m ) if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector )) $ found ->attach ($ m );
768769 $ this ->setMatches ($ found );
769770 return $ this ;
770771 }
@@ -1009,7 +1010,7 @@ public function not($selector) {
10091010 foreach ($ this ->matches as $ m ) if ($ selector ->contains ($ m )) $ found ->attach ($ m );
10101011 }
10111012 else {
1012- foreach ($ this ->matches as $ m ) if (!qp ($ m , NULL , $ this ->options )->is ($ selector )) $ found ->attach ($ m );
1013+ foreach ($ this ->matches as $ m ) if (!QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector )) $ found ->attach ($ m );
10131014 }
10141015 $ this ->setMatches ($ found );
10151016 return $ this ;
@@ -1863,7 +1864,7 @@ public function replaceAll($selector, \DOMDocument $document) {
18631864 $ node = $ document ->importNode ($ node );
18641865 $ item ->parentNode ->replaceChild ($ node , $ item );
18651866 }
1866- return qp ($ document , NULL , $ this ->options );
1867+ return QueryPath:: with ($ document , NULL , $ this ->options );
18671868 }
18681869 /**
18691870 * Add more elements to the current set of matches.
@@ -1886,8 +1887,9 @@ public function add($selector) {
18861887 // This is destructive, so we need to set $last:
18871888 $ this ->last = $ this ->matches ;
18881889
1889- foreach (qp ($ this ->document , $ selector , $ this ->options )->get () as $ item )
1890+ foreach (QueryPath:: with ($ this ->document , $ selector , $ this ->options )->get () as $ item ) {
18901891 $ this ->matches ->attach ($ item );
1892+ }
18911893 return $ this ;
18921894 }
18931895 /**
@@ -2097,14 +2099,14 @@ public function closest($selector) {
20972099 $ found = new \SplObjectStorage ();
20982100 foreach ($ this ->matches as $ m ) {
20992101
2100- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
2102+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
21012103 $ found ->attach ($ m );
21022104 }
21032105 else {
21042106 while ($ m ->parentNode ->nodeType !== XML_DOCUMENT_NODE ) {
21052107 $ m = $ m ->parentNode ;
21062108 // Is there any case where parent node is not an element?
2107- if ($ m ->nodeType === XML_ELEMENT_NODE && qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
2109+ if ($ m ->nodeType === XML_ELEMENT_NODE && QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
21082110 $ found ->attach ($ m );
21092111 break ;
21102112 }
@@ -2137,7 +2139,7 @@ public function parent($selector = NULL) {
21372139 // Is there any case where parent node is not an element?
21382140 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
21392141 if (!empty ($ selector )) {
2140- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
2142+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
21412143 $ found ->attach ($ m );
21422144 break ;
21432145 }
@@ -2173,7 +2175,7 @@ public function parents($selector = NULL) {
21732175 // Is there any case where parent node is not an element?
21742176 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
21752177 if (!empty ($ selector )) {
2176- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 )
2178+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 )
21772179 $ found ->attach ($ m );
21782180 }
21792181 else
@@ -2775,7 +2777,7 @@ public function next($selector = NULL) {
27752777 $ m = $ m ->nextSibling ;
27762778 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
27772779 if (!empty ($ selector )) {
2778- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
2780+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
27792781 $ found ->attach ($ m );
27802782 break ;
27812783 }
@@ -2813,7 +2815,7 @@ public function nextAll($selector = NULL) {
28132815 $ m = $ m ->nextSibling ;
28142816 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
28152817 if (!empty ($ selector )) {
2816- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
2818+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
28172819 $ found ->attach ($ m );
28182820 }
28192821 }
@@ -2850,7 +2852,7 @@ public function prev($selector = NULL) {
28502852 $ m = $ m ->previousSibling ;
28512853 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
28522854 if (!empty ($ selector )) {
2853- if (qp ($ m , NULL , $ this ->options )->is ($ selector )) {
2855+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector )) {
28542856 $ found ->attach ($ m );
28552857 break ;
28562858 }
@@ -2888,7 +2890,7 @@ public function prevAll($selector = NULL) {
28882890 $ m = $ m ->previousSibling ;
28892891 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
28902892 if (!empty ($ selector )) {
2891- if (qp ($ m , NULL , $ this ->options )->is ($ selector )) {
2893+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector )) {
28922894 $ found ->attach ($ m );
28932895 }
28942896 }
@@ -2910,7 +2912,7 @@ public function peers($selector = NULL) {
29102912 foreach ($ m ->parentNode ->childNodes as $ kid ) {
29112913 if ($ kid ->nodeType == XML_ELEMENT_NODE && $ m !== $ kid ) {
29122914 if (!empty ($ selector )) {
2913- if (qp ($ kid , NULL , $ this ->options )->is ($ selector )) {
2915+ if (QueryPath:: with ($ kid , NULL , $ this ->options )->is ($ selector )) {
29142916 $ found ->attach ($ kid );
29152917 }
29162918 }
@@ -3458,7 +3460,7 @@ public function nextUntil($selector = NULL) {
34583460 $ m = $ m ->nextSibling ;
34593461 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
34603462 if (!empty ($ selector )) {
3461- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
3463+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 ) {
34623464 break ;
34633465 }
34643466 else {
@@ -3500,7 +3502,7 @@ public function prevUntil($selector = NULL) {
35003502 while (isset ($ m ->previousSibling )) {
35013503 $ m = $ m ->previousSibling ;
35023504 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
3503- if (!empty ($ selector ) && qp ($ m , NULL , $ this ->options )->is ($ selector ))
3505+ if (!empty ($ selector ) && QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ))
35043506 break ;
35053507 else
35063508 $ found ->attach ($ m );
@@ -3534,7 +3536,7 @@ public function parentsUntil($selector = NULL) {
35343536 // Is there any case where parent node is not an element?
35353537 if ($ m ->nodeType === XML_ELEMENT_NODE ) {
35363538 if (!empty ($ selector )) {
3537- if (qp ($ m , NULL , $ this ->options )->is ($ selector ) > 0 )
3539+ if (QueryPath:: with ($ m , NULL , $ this ->options )->is ($ selector ) > 0 )
35383540 break ;
35393541 else
35403542 $ found ->attach ($ m );
0 commit comments