Code Duplication    Length = 23-23 lines in 2 locations

src/FluentDOM/Serializer/Html.php 1 location

@@ 11-33 (lines=23) @@
8
9
namespace FluentDOM\Serializer {
10
11
  class Html {
12
    /**
13
     * @var \DOMNode
14
     */
15
    protected $_node = NULL;
16
17
    /**
18
     * @param \DOMNode $node
19
     */
20
    public function __construct(\DOMNode $node) {
21
      $this->_node = $node;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function __toString() {
28
      return $this->_node instanceof \DOMDocument
29
        ? $this->_node->saveHTML()
30
        : $this->_node->ownerDocument->saveHTML($this->_node);
31
    }
32
  }
33
}

src/FluentDOM/Serializer/Xml.php 1 location

@@ 11-33 (lines=23) @@
8
9
namespace FluentDOM\Serializer {
10
11
  class Xml {
12
    /**
13
     * @var \DOMNode
14
     */
15
    protected $_node = NULL;
16
17
    /**
18
     * @param \DOMNode $node
19
     */
20
    public function __construct(\DOMNode $node) {
21
      $this->_node = $node;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function __toString() {
28
      return $this->_node instanceof \DOMDocument
29
        ? $this->_node->saveXml()
30
        : $this->_node->ownerDocument->saveXml($this->_node);
31
    }
32
  }
33
}