From 92b890bf2506e279353953005e2be641cf50f2ca Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 17 Nov 2010 11:35:26 +0100 Subject: [PATCH] removed usage of SplObjectStorage as PHP < 5.3 does not support ArrayAccess --- lib/Twig/NodeVisitor/SafeAnalysis.php | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Twig/NodeVisitor/SafeAnalysis.php b/lib/Twig/NodeVisitor/SafeAnalysis.php index 73b1037..79d1f06 100644 --- a/lib/Twig/NodeVisitor/SafeAnalysis.php +++ b/lib/Twig/NodeVisitor/SafeAnalysis.php @@ -6,17 +6,17 @@ class Twig_NodeVisitor_SafeAnalysis implements Twig_NodeVisitorInterface public function __construct() { - $this->data = new SplObjectStorage(); + $this->data = array(); } public function getSafe(Twig_NodeInterface $node) { - return isset($this->data[$node]) ? $this->data[$node] : null; + return isset($this->data[spl_object_hash($node)]) ? $this->data[spl_object_hash($node)] : null; } protected function setSafe(Twig_NodeInterface $node, array $safe) { - $this->data[$node] = $safe; + $this->data[spl_object_hash($node)] = $safe; } public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) -- 1.7.2.5