FluidXml\FluidContext::__construct PHP Method

__construct() public method

public __construct ( $document, $handler, $context )
    public function __construct($document, $handler, $context)
    {
        $this->document = $document;
        $this->handler = $handler;
        if (!\is_array($context) && !$context instanceof \Traversable) {
            // DOMDocument, DOMElement and DOMNode are not iterable.
            // DOMNodeList and FluidContext are iterable.
            $context = [$context];
        }
        foreach ($context as $n) {
            if (!$n instanceof \DOMNode) {
                throw new \Exception('Node type not recognized.');
            }
            $this->nodes[] = $n;
        }
    }