Skip to content

Commit ca2ff43

Browse files
committed
Adding gitignore and adding string magic function
1 parent b6f032b commit ca2ff43

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
composer.lock
2+
vendor

src/DOMDoc.php

+7
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,13 @@ function out($context = NULL) {
717717
return $this->saveXML($context, LIBXML_NOEMPTYTAG);
718718
}
719719
}
720+
721+
/**
722+
* Magic method for casting a DOMDoc as a string
723+
*/
724+
function __toString() {
725+
return $this->out();
726+
}
720727

721728
private function createContext(&$context, $type = 'xpath', $createDocument = TRUE) {
722729
if (!$context && $createDocument) {

0 commit comments

Comments
 (0)