File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/Symfony/Component/DomCrawler Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -313,14 +313,6 @@ public function addNodes(array $nodes)
313
313
*/
314
314
public function addNode (\DOMNode $ node )
315
315
{
316
- if (null !== $ this ->document && $ this ->document !== $ node ->ownerDocument ) {
317
- @trigger_error ('Attaching DOM nodes from multiple documents in a Crawler is deprecated as of 2.8 and will be forbidden in 3.0. ' , E_USER_DEPRECATED );
318
- }
319
-
320
- if (null === $ this ->document ) {
321
- $ this ->document = $ node ->ownerDocument ;
322
- }
323
-
324
316
if ($ node instanceof \DOMDocument) {
325
317
$ node = $ node ->documentElement ;
326
318
}
@@ -329,6 +321,14 @@ public function addNode(\DOMNode $node)
329
321
throw new \InvalidArgumentException (sprintf ('Nodes set in a Crawler must be DOMElement or DOMDocument instances, "%s" given. ' , get_class ($ node )));
330
322
}
331
323
324
+ if (null !== $ this ->document && $ this ->document !== $ node ->ownerDocument ) {
325
+ @trigger_error ('Attaching DOM nodes from multiple documents in a Crawler is deprecated as of 2.8 and will be forbidden in 3.0. ' , E_USER_DEPRECATED );
326
+ }
327
+
328
+ if (null === $ this ->document ) {
329
+ $ this ->document = $ node ->ownerDocument ;
330
+ }
331
+
332
332
parent ::attach ($ node );
333
333
}
334
334
You can’t perform that action at this time.
0 commit comments