summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/Node/Expression/Array.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/lib/Twig/Node/Expression/Array.php')
-rw-r--r--inc/lib/Twig/Node/Expression/Array.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/inc/lib/Twig/Node/Expression/Array.php b/inc/lib/Twig/Node/Expression/Array.php
index 1da785fe..0e77bb08 100644
--- a/inc/lib/Twig/Node/Expression/Array.php
+++ b/inc/lib/Twig/Node/Expression/Array.php
@@ -3,7 +3,7 @@
/*
* This file is part of Twig.
*
- * (c) 2009 Fabien Potencier
+ * (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -43,7 +43,7 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression
foreach ($this->getKeyValuePairs() as $pair) {
// we compare the string representation of the keys
// to avoid comparing the line numbers which are not relevant here.
- if ((string) $key == (string) $pair['key']) {
+ if ((string) $key === (string) $pair['key']) {
return true;
}
}
@@ -54,17 +54,12 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression
public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null)
{
if (null === $key) {
- $key = new Twig_Node_Expression_Constant(++$this->index, $value->getLine());
+ $key = new Twig_Node_Expression_Constant(++$this->index, $value->getTemplateLine());
}
array_push($this->nodes, $key, $value);
}
- /**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
public function compile(Twig_Compiler $compiler)
{
$compiler->raw('array(');
@@ -84,3 +79,5 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression
$compiler->raw(')');
}
}
+
+class_alias('Twig_Node_Expression_Array', 'Twig\Node\Expression\ArrayExpression', false);