[Twig] removed obsolete conditions on Twig versions
This commit is contained in:
parent
f71193c055
commit
c3ff76a989
@ -95,22 +95,10 @@ class TransNode extends \Twig_Node
|
||||
|
||||
preg_match_all('/(?<!%)%([^%]+)%/', $msg, $matches);
|
||||
|
||||
if (version_compare(\Twig_Environment::VERSION, '1.5', '>=')) {
|
||||
foreach ($matches[1] as $var) {
|
||||
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine());
|
||||
if (!$vars->hasElement($key)) {
|
||||
$vars->addElement(new \Twig_Node_Expression_Name($var, $body->getLine()), $key);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$current = array();
|
||||
foreach ($vars as $name => $var) {
|
||||
$current[$name] = true;
|
||||
}
|
||||
foreach ($matches[1] as $var) {
|
||||
if (!isset($current['%'.$var.'%'])) {
|
||||
$vars->setNode('%'.$var.'%', new \Twig_Node_Expression_Name($var, $body->getLine()));
|
||||
}
|
||||
foreach ($matches[1] as $var) {
|
||||
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine());
|
||||
if (!$vars->hasElement($key)) {
|
||||
$vars->addElement(new \Twig_Node_Expression_Name($var, $body->getLine()), $key);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,15 +16,6 @@ use Symfony\Bridge\Twig\Node\FormThemeNode;
|
||||
|
||||
class FormThemeTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
|
||||
$this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
|
||||
}
|
||||
}
|
||||
|
||||
public function testConstructor()
|
||||
{
|
||||
$form = new \Twig_Node_Expression_Name('form', 0);
|
||||
|
@ -16,15 +16,6 @@ use Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode;
|
||||
|
||||
class SearchAndRenderBlockNodeTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
|
||||
$this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
|
||||
}
|
||||
}
|
||||
|
||||
public function testCompileWidget()
|
||||
{
|
||||
$arguments = new \Twig_Node(array(
|
||||
|
@ -17,15 +17,6 @@ use Symfony\Bridge\Twig\Node\FormThemeNode;
|
||||
|
||||
class FormThemeTokenParserTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
|
||||
$this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestsForFormTheme
|
||||
*/
|
||||
|
Reference in New Issue
Block a user