File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313namespace Derafu \Xml \Contract ;
1414
1515use Derafu \Xml \Exception \XmlException ;
16+ use DOMElement ;
1617use DOMNode ;
1718use DOMNodeList ;
1819use JsonSerializable ;
@@ -53,6 +54,14 @@ public function setFormatOutput(bool $formatOutput): static;
5354 */
5455 public function setPreserveWhiteSpace (bool $ preserveWhiteSpace ): static ;
5556
57+ /**
58+ * Returns the root element instance of the document.
59+ *
60+ * @return DOMElement|null The root element instance of the document or
61+ * `null` if it is not present.
62+ */
63+ public function getDocumentElement (): ?DOMElement ;
64+
5665 /**
5766 * Returns the name of the root tag of the XML.
5867 *
Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ public function setPreserveWhiteSpace(bool $preserveWhiteSpace): static
9191 return $ this ;
9292 }
9393
94+ /**
95+ * {@inheritDoc}
96+ */
97+ public function getDocumentElement (): ?DOMElement
98+ {
99+ return $ this ->documentElement ;
100+ }
101+
94102 /**
95103 * {@inheritDoc}
96104 */
@@ -297,14 +305,6 @@ public function toArray(): array
297305 return $ this ->query ('/ ' );
298306 }
299307
300- /**
301- * {@inheritDoc}
302- */
303- public function getDocumentElement (): ?DOMElement
304- {
305- return $ this ->documentElement ;
306- }
307-
308308 /**
309309 * {@inheritDoc}
310310 */
You can’t perform that action at this time.
0 commit comments