removed obsolete Twig_Simple* classes

This commit is contained in:
Fabien Potencier
2014-11-13 08:27:06 +01:00
parent df3d5335fa
commit 176f60d79d
9 changed files with 29 additions and 95 deletions
+6 -9
View File
@@ -39,9 +39,8 @@ Filters
* ``Twig_Filter_Method``
* ``Twig_Filter_Node``
* As of Twig 2.x, the ``Twig_SimpleFilter`` class is deprecated and will be
removed in Twig 3.x (use ``Twig_Filter`` instead). In Twig 2.x,
``Twig_SimpleFilter`` is just an alias for ``Twig_Filter``.
* As of Twig 2.x, the ``Twig_SimpleFilter`` class is removed and replaced with
the ``Twig_Filter`` class.
Functions
---------
@@ -56,9 +55,8 @@ Functions
* ``Twig_Function_Method``
* ``Twig_Function_Node``
* As of Twig 2.x, the ``Twig_SimpleFunction`` class is deprecated and will be
removed in Twig 3.x (use ``Twig_Function`` instead). In Twig 2.x,
``Twig_SimpleFunction`` is just an alias for ``Twig_Function``.
* As of Twig 2.x, the ``Twig_SimpleFunction`` class is removed and replaced with
the ``Twig_Function`` class.
Tests
-----
@@ -73,9 +71,8 @@ Tests
* ``Twig_Test_Method``
* ``Twig_Test_Node``
* As of Twig 2.x, the ``Twig_SimpleTest`` class is deprecated and will be
removed in Twig 3.x (use ``Twig_Test`` instead). In Twig 2.x,
``Twig_SimpleTest`` is just an alias for ``Twig_Test``.
* As of Twig 2.x, the ``Twig_SimpleTest`` class is removed and replaced with
the ``Twig_Test`` class.
* The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
as`` and ``divisible by`` respectively.
-21
View File
@@ -1,21 +0,0 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2009-2012 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Represents a template filter.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since 2.0 (to be removed in 3.0)
*/
class Twig_SimpleFilter extends Twig_Filter
{
}
-21
View File
@@ -1,21 +0,0 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2010-2012 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Represents a template function.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since 2.0 (to be removed in 3.0)
*/
class Twig_SimpleFunction extends Twig_Function
{
}
-21
View File
@@ -1,21 +0,0 @@
<?php
/*
* This file is part of Twig.
*
* (c) 2010-2012 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Represents a template test.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since 2.0 (to be removed in 3.0)
*/
class Twig_SimpleTest extends Twig_Test
{
}
+3 -3
View File
@@ -200,21 +200,21 @@ class Twig_Tests_EnvironmentTest_Extension extends Twig_Extension
public function getFilters()
{
return array(
new Twig_SimpleFilter('foo_filter', 'foo_filter'),
new Twig_Filter('foo_filter', 'foo_filter'),
);
}
public function getTests()
{
return array(
new Twig_SimpleTest('foo_test', 'foo_test'),
new Twig_Test('foo_test', 'foo_test'),
);
}
public function getFunctions()
{
return array(
new Twig_SimpleFunction('foo_function', 'foo_function'),
new Twig_Function('foo_function', 'foo_function'),
);
}
+13 -13
View File
@@ -136,31 +136,31 @@ class TwigTestExtension extends Twig_Extension
public function getFilters()
{
return array(
new Twig_SimpleFilter('§', array($this, '§Filter')),
new Twig_SimpleFilter('escape_and_nl2br', array($this, 'escape_and_nl2br'), array('needs_environment' => true, 'is_safe' => array('html'))),
new Twig_SimpleFilter('nl2br', array($this, 'nl2br'), array('pre_escape' => 'html', 'is_safe' => array('html'))),
new Twig_SimpleFilter('escape_something', array($this, 'escape_something'), array('is_safe' => array('something'))),
new Twig_SimpleFilter('preserves_safety', array($this, 'preserves_safety'), array('preserves_safety' => array('html'))),
new Twig_SimpleFilter('*_path', array($this, 'dynamic_path')),
new Twig_SimpleFilter('*_foo_*_bar', array($this, 'dynamic_foo')),
new Twig_Filter('§', array($this, '§Filter')),
new Twig_Filter('escape_and_nl2br', array($this, 'escape_and_nl2br'), array('needs_environment' => true, 'is_safe' => array('html'))),
new Twig_Filter('nl2br', array($this, 'nl2br'), array('pre_escape' => 'html', 'is_safe' => array('html'))),
new Twig_Filter('escape_something', array($this, 'escape_something'), array('is_safe' => array('something'))),
new Twig_Filter('preserves_safety', array($this, 'preserves_safety'), array('preserves_safety' => array('html'))),
new Twig_Filter('*_path', array($this, 'dynamic_path')),
new Twig_Filter('*_foo_*_bar', array($this, 'dynamic_foo')),
);
}
public function getFunctions()
{
return array(
new Twig_SimpleFunction('§', array($this, '§Function')),
new Twig_SimpleFunction('safe_br', array($this, 'br'), array('is_safe' => array('html'))),
new Twig_SimpleFunction('unsafe_br', array($this, 'br')),
new Twig_SimpleFunction('*_path', array($this, 'dynamic_path')),
new Twig_SimpleFunction('*_foo_*_bar', array($this, 'dynamic_foo')),
new Twig_Function('§', array($this, '§Function')),
new Twig_Function('safe_br', array($this, 'br'), array('is_safe' => array('html'))),
new Twig_Function('unsafe_br', array($this, 'br')),
new Twig_Function('*_path', array($this, 'dynamic_path')),
new Twig_Function('*_foo_*_bar', array($this, 'dynamic_foo')),
);
}
public function getTests()
{
return array(
new Twig_SimpleTest('multi word', array($this, 'is_multi_word')),
new Twig_Test('multi word', array($this, 'is_multi_word')),
);
}
@@ -111,7 +111,7 @@ class Twig_Tests_Node_Expression_FilterTest extends Twig_Test_NodeTestCase
protected function getEnvironment()
{
$env = new Twig_Environment();
$env->addFilter(new Twig_SimpleFilter('anonymous', function () {}));
$env->addFilter(new Twig_Filter('anonymous', function () {}));
return $env;
}
@@ -24,10 +24,10 @@ class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase
public function getTests()
{
$environment = new Twig_Environment();
$environment->addFunction(new Twig_SimpleFunction('foo', 'foo', array()));
$environment->addFunction(new Twig_SimpleFunction('bar', 'bar', array('needs_environment' => true)));
$environment->addFunction(new Twig_SimpleFunction('foofoo', 'foofoo', array('needs_context' => true)));
$environment->addFunction(new Twig_SimpleFunction('foobar', 'foobar', array('needs_environment' => true, 'needs_context' => true)));
$environment->addFunction(new Twig_Function('foo', 'foo', array()));
$environment->addFunction(new Twig_Function('bar', 'bar', array('needs_environment' => true)));
$environment->addFunction(new Twig_Function('foofoo', 'foofoo', array('needs_context' => true)));
$environment->addFunction(new Twig_Function('foobar', 'foobar', array('needs_environment' => true, 'needs_context' => true)));
$tests = array();
@@ -77,7 +77,7 @@ class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase
protected function getEnvironment()
{
$env = new Twig_Environment();
$env->addFunction(new Twig_SimpleFunction('anonymous', function () {}));
$env->addFunction(new Twig_Function('anonymous', function () {}));
return $env;
}
+1 -1
View File
@@ -46,7 +46,7 @@ class Twig_Tests_Node_Expression_TestTest extends Twig_Test_NodeTestCase
protected function getEnvironment()
{
$env = new Twig_Environment();
$env->addTest(new Twig_SimpleTest('anonymous', function () {}));
$env->addTest(new Twig_Test('anonymous', function () {}));
return $env;
}