You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/DiDom/Document.php
+4-5
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,6 @@
3
3
namespaceDiDom;
4
4
5
5
useDOMDocument;
6
-
useDOMElement;
7
6
useDOMXPath;
8
7
useInvalidArgumentException;
9
8
useRuntimeException;
@@ -66,11 +65,11 @@ public function createElement($name, $value = '', $attributes = [])
66
65
/**
67
66
* Adds new child at the end of the children.
68
67
*
69
-
* @param \DiDom\Element|\DOMElement|array $nodes The appended child.
68
+
* @param \DiDom\Element|\DOMNode|array $nodes The appended child.
70
69
*
71
70
* @return \DiDom\Document
72
71
*
73
-
* @throws \InvalidArgumentException if the provided argument is not an instance of \DOMElement or \DiDom\Element
72
+
* @throws \InvalidArgumentException if the provided argument is not an instance of \DOMNode or \DiDom\Element
74
73
*/
75
74
publicfunctionappendChild($nodes)
76
75
{
@@ -81,8 +80,8 @@ public function appendChild($nodes)
81
80
$node = $node->getNode();
82
81
}
83
82
84
-
if (!$nodeinstanceofDOMElement) {
85
-
thrownewInvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s\Element or DOMElement, %s given', __METHOD__, __NAMESPACE__, (is_object($node) ? get_class($node) : gettype($node))));
83
+
if (!$nodeinstanceof\DOMNode) {
84
+
thrownewInvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s\Element or DOMNode, %s given', __METHOD__, __NAMESPACE__, (is_object($node) ? get_class($node) : gettype($node))));
Copy file name to clipboardexpand all lines: src/DiDom/Element.php
+7-7
Original file line number
Diff line number
Diff line change
@@ -43,11 +43,11 @@ public function __construct($name, $value = '', $attributes = [])
43
43
/**
44
44
* Adds new child at the end of the children.
45
45
*
46
-
* @param \DiDom\Element|\DOMElement|array $nodes The appended child.
46
+
* @param \DiDom\Element|\DOMNode|array $nodes The appended child.
47
47
*
48
48
* @return \DiDom\Element
49
49
*
50
-
* @throws \InvalidArgumentException if the provided argument is not an instance of \DOMElement or \DiDom\Element
50
+
* @throws \InvalidArgumentException if the provided argument is not an instance of \DOMNode or \DiDom\Element
51
51
*/
52
52
publicfunctionappendChild($nodes)
53
53
{
@@ -58,8 +58,8 @@ public function appendChild($nodes)
58
58
$node = $node->getNode();
59
59
}
60
60
61
-
if (!$nodeinstanceofDOMElement) {
62
-
thrownewInvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s\Element or DOMElement, %s given', __METHOD__, __NAMESPACE__, (is_object($node) ? get_class($node) : gettype($node))));
61
+
if (!$nodeinstanceof\DOMNode) {
62
+
thrownewInvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s\Element or DOMNode, %s given', __METHOD__, __NAMESPACE__, (is_object($node) ? get_class($node) : gettype($node))));
63
63
}
64
64
65
65
libxml_use_internal_errors(true);
@@ -220,12 +220,12 @@ public function innerHtml($options = 0)
0 commit comments