public function wrapNode(Node $node)
    {
        if($node instanceof NodeWrapper)
        {
            throw new \InvalidArgumentException('Can\'t wrap a NodeWrapper node');
        }

        $oid = spl_object_hash($node);
        if(!isset($this->wrappers[$oid]) || $this->wrappers[$oid]->getNode() !== $node)
        {
            $this->wrappers[$oid] = new NodeWrapper($node, $this);
        }

        return $this->wrappers[$oid];
    }
public function wrapNode(Node $node)
    {
        if($node instanceof NodeWrapper)
        {
            throw new \InvalidArgumentException('Can\'t wrap a NodeWrapper node');
        }

        $oid = spl_object_hash($node);
        if(!isset($this->wrappers[$oid]) || $this->wrappers[$oid]->getNode() !== $node)
        {
            $this->wrappers[$oid] = new NodeWrapper($node, $this);
        }

        return $this->wrappers[$oid];
    }
public function wrapNode ( Node $ node ) { if ( $ node instanceof NodeWrapper ) { throw new \ InvalidArgumentException ( 'Can\'t wrap a NodeWrapper node' ) ; } $ oid = spl_object_hash ( $ node ) ; if ( ! isset ( $ this -> wrappers [ $ oid ] ) || $ this -> wrappers [ $ oid ] -> getNode ( ) !== $ node ) { $ this -> wrappers [ $ oid ] = new NodeWrapper ( $ node , $ this ) ; } return $ this -> wrappers [ $ oid ] ; }
wraps the node using the NodeWrapper class

@param Node $node

@return NodeWrapper
wraps the node using the NodeWrapper class