FluentDOM\Transformer\Namespaces\Optimize::__construct PHP Méthode

__construct() public méthode

The second argument allows to provide namespaces and prefixes. The keys of the array are the namespace uri, the values are the prefixes. If a namespace is not provided it is read from the source node. You can use the same prefix for multiple namespace uris. Empty prefixes are possible (default namespace for an element). It is highly recommend that you always use a non-empty prefix if the here are attributes in that namespace. Attributes always need a prefix to make use of the namespace.
public __construct ( DOMDocument $document, array $namespaces = [] )
$document DOMDocument
$namespaces array
    public function __construct(\DOMDocument $document, array $namespaces = [])
    {
        $this->_document = new Document();
        foreach ($document->childNodes as $node) {
            $this->_document->appendChild($this->_document->importNode($node, TRUE));
        }
        $this->_namespaceUris = $namespaces;
    }