diff --git a/src/Symfony/Bridge/Twig/Node/TransNode.php b/src/Symfony/Bridge/Twig/Node/TransNode.php index e8571d5be1..2409090699 100644 --- a/src/Symfony/Bridge/Twig/Node/TransNode.php +++ b/src/Symfony/Bridge/Twig/Node/TransNode.php @@ -36,7 +36,7 @@ class TransNode extends \Twig_Node $defaults = $this->getNode('vars'); $vars = null; } - list($msg, $defaults) = $this->compileString($this->getNode('body'), $defaults, (boolean) $vars); + list($msg, $defaults) = $this->compileString($this->getNode('body'), $defaults, (bool) $vars); $method = null === $this->getNode('count') ? 'trans' : 'transChoice'; diff --git a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php index d331186c40..e02637f237 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php @@ -14,22 +14,17 @@ namespace Symfony\Bridge\Twig\Tests\Node; use Symfony\Bridge\Twig\Node\TransNode; /** - * * @author Asmir Mustafic - * */ class TransNodeTest extends \PHPUnit_Framework_TestCase { - public function testCompileStrict() { $body = new \Twig_Node_Text('trans %var%', 0); $vars = new \Twig_Node_Expression_Name('foo', 0); $node = new TransNode($body, null, null, $vars); - $env = new \Twig_Environment(null, array( - 'strict_variables' => true, - )); + $env = new \Twig_Environment(null, array('strict_variables' => true)); $compiler = new \Twig_Compiler($env); $this->assertEquals( @@ -49,6 +44,7 @@ class TransNodeTest extends \PHPUnit_Framework_TestCase return sprintf('$this->getContext($context, "%s", true)', $name); } + protected function getVariableGetterWithStrictCheck($name) { if (version_compare(phpversion(), '5.4.0RC1', '>=')) {