class Twig_NodeVisitor_SafeAnalysis implements Twig_NodeVisitorInterface
{
- protected $data = array();
+ protected $data;
- public function getSafe(Twig_NodeInterface $node)
+ public function __construct()
{
- $hash = spl_object_hash($node);
+ $this->data = new SplObjectStorage();
+ }
- return isset($this->data[$hash]) ? $this->data[$hash] : null;
+ public function getSafe(Twig_NodeInterface $node)
+ {
+ return isset($this->data[$node]) ? $this->data[$node] : null;
}
protected function setSafe(Twig_NodeInterface $node, array $safe)
{
- $hash = spl_object_hash($node);
- $this->data[$hash] = $safe;
+ $this->data[$node] = $safe;
}
public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)