Completed
Push — master ( 39b072...2fa9c0 )
by Thomas
02:12
created

src/FluentDOM/Serializer/Xml.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Serialize a DOM into an Xml string.
4
 *
5
 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
6
 * @copyright Copyright (c) 2009-2016 Bastian Feder, Thomas Weinert
7
 */
8
9
namespace FluentDOM\Serializer {
10
11 View Code Duplication
  class Xml {
1 ignored issue
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
    /**
13
     * @var \DOMNode
14
     */
15
    protected $_node = NULL;
16
17
    /**
18
     * @param \DOMNode $node
19
     */
20 2
    public function __construct(\DOMNode $node) {
21 2
      $this->_node = $node;
22 2
    }
23
24
    /**
25
     * @return string
26
     */
27 2
    public function __toString() {
28 2
      return $this->_node instanceof \DOMDocument
29 2
        ? $this->_node->saveXml()
30 2
        : $this->_node->ownerDocument->saveXml($this->_node);
31
    }
32
  }
33
}