fixed CS
This commit is contained in:
parent
11f9497e50
commit
17d7186cf8
|
@ -36,7 +36,7 @@ class TransNode extends \Twig_Node
|
||||||
$defaults = $this->getNode('vars');
|
$defaults = $this->getNode('vars');
|
||||||
$vars = null;
|
$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';
|
$method = null === $this->getNode('count') ? 'trans' : 'transChoice';
|
||||||
|
|
||||||
|
|
|
@ -14,22 +14,17 @@ namespace Symfony\Bridge\Twig\Tests\Node;
|
||||||
use Symfony\Bridge\Twig\Node\TransNode;
|
use Symfony\Bridge\Twig\Node\TransNode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Asmir Mustafic <goetas@gmail.com>
|
* @author Asmir Mustafic <goetas@gmail.com>
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class TransNodeTest extends \PHPUnit_Framework_TestCase
|
class TransNodeTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testCompileStrict()
|
public function testCompileStrict()
|
||||||
{
|
{
|
||||||
$body = new \Twig_Node_Text('trans %var%', 0);
|
$body = new \Twig_Node_Text('trans %var%', 0);
|
||||||
$vars = new \Twig_Node_Expression_Name('foo', 0);
|
$vars = new \Twig_Node_Expression_Name('foo', 0);
|
||||||
$node = new TransNode($body, null, null, $vars);
|
$node = new TransNode($body, null, null, $vars);
|
||||||
|
|
||||||
$env = new \Twig_Environment(null, array(
|
$env = new \Twig_Environment(null, array('strict_variables' => true));
|
||||||
'strict_variables' => true,
|
|
||||||
));
|
|
||||||
$compiler = new \Twig_Compiler($env);
|
$compiler = new \Twig_Compiler($env);
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
|
@ -49,6 +44,7 @@ class TransNodeTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
return sprintf('$this->getContext($context, "%s", true)', $name);
|
return sprintf('$this->getContext($context, "%s", true)', $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getVariableGetterWithStrictCheck($name)
|
protected function getVariableGetterWithStrictCheck($name)
|
||||||
{
|
{
|
||||||
if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
|
if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
|
||||||
|
|
Reference in New Issue