mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 13:26:37 +00:00
removed obsolete Twig_Simple* classes
This commit is contained in:
+6
-9
@@ -39,9 +39,8 @@ Filters
|
|||||||
* ``Twig_Filter_Method``
|
* ``Twig_Filter_Method``
|
||||||
* ``Twig_Filter_Node``
|
* ``Twig_Filter_Node``
|
||||||
|
|
||||||
* As of Twig 2.x, the ``Twig_SimpleFilter`` class is deprecated and will be
|
* As of Twig 2.x, the ``Twig_SimpleFilter`` class is removed and replaced with
|
||||||
removed in Twig 3.x (use ``Twig_Filter`` instead). In Twig 2.x,
|
the ``Twig_Filter`` class.
|
||||||
``Twig_SimpleFilter`` is just an alias for ``Twig_Filter``.
|
|
||||||
|
|
||||||
Functions
|
Functions
|
||||||
---------
|
---------
|
||||||
@@ -56,9 +55,8 @@ Functions
|
|||||||
* ``Twig_Function_Method``
|
* ``Twig_Function_Method``
|
||||||
* ``Twig_Function_Node``
|
* ``Twig_Function_Node``
|
||||||
|
|
||||||
* As of Twig 2.x, the ``Twig_SimpleFunction`` class is deprecated and will be
|
* As of Twig 2.x, the ``Twig_SimpleFunction`` class is removed and replaced with
|
||||||
removed in Twig 3.x (use ``Twig_Function`` instead). In Twig 2.x,
|
the ``Twig_Function`` class.
|
||||||
``Twig_SimpleFunction`` is just an alias for ``Twig_Function``.
|
|
||||||
|
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
@@ -73,9 +71,8 @@ Tests
|
|||||||
* ``Twig_Test_Method``
|
* ``Twig_Test_Method``
|
||||||
* ``Twig_Test_Node``
|
* ``Twig_Test_Node``
|
||||||
|
|
||||||
* As of Twig 2.x, the ``Twig_SimpleTest`` class is deprecated and will be
|
* As of Twig 2.x, the ``Twig_SimpleTest`` class is removed and replaced with
|
||||||
removed in Twig 3.x (use ``Twig_Test`` instead). In Twig 2.x,
|
the ``Twig_Test`` class.
|
||||||
``Twig_SimpleTest`` is just an alias for ``Twig_Test``.
|
|
||||||
|
|
||||||
* The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
|
* The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
|
||||||
as`` and ``divisible by`` respectively.
|
as`` and ``divisible by`` respectively.
|
||||||
|
|||||||
@@ -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
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -200,21 +200,21 @@ class Twig_Tests_EnvironmentTest_Extension extends Twig_Extension
|
|||||||
public function getFilters()
|
public function getFilters()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Twig_SimpleFilter('foo_filter', 'foo_filter'),
|
new Twig_Filter('foo_filter', 'foo_filter'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTests()
|
public function getTests()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Twig_SimpleTest('foo_test', 'foo_test'),
|
new Twig_Test('foo_test', 'foo_test'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Twig_SimpleFunction('foo_function', 'foo_function'),
|
new Twig_Function('foo_function', 'foo_function'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,31 +136,31 @@ class TwigTestExtension extends Twig_Extension
|
|||||||
public function getFilters()
|
public function getFilters()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Twig_SimpleFilter('§', array($this, '§Filter')),
|
new Twig_Filter('§', array($this, '§Filter')),
|
||||||
new Twig_SimpleFilter('escape_and_nl2br', array($this, 'escape_and_nl2br'), array('needs_environment' => true, 'is_safe' => array('html'))),
|
new Twig_Filter('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_Filter('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_Filter('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_Filter('preserves_safety', array($this, 'preserves_safety'), array('preserves_safety' => array('html'))),
|
||||||
new Twig_SimpleFilter('*_path', array($this, 'dynamic_path')),
|
new Twig_Filter('*_path', array($this, 'dynamic_path')),
|
||||||
new Twig_SimpleFilter('*_foo_*_bar', array($this, 'dynamic_foo')),
|
new Twig_Filter('*_foo_*_bar', array($this, 'dynamic_foo')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Twig_SimpleFunction('§', array($this, '§Function')),
|
new Twig_Function('§', array($this, '§Function')),
|
||||||
new Twig_SimpleFunction('safe_br', array($this, 'br'), array('is_safe' => array('html'))),
|
new Twig_Function('safe_br', array($this, 'br'), array('is_safe' => array('html'))),
|
||||||
new Twig_SimpleFunction('unsafe_br', array($this, 'br')),
|
new Twig_Function('unsafe_br', array($this, 'br')),
|
||||||
new Twig_SimpleFunction('*_path', array($this, 'dynamic_path')),
|
new Twig_Function('*_path', array($this, 'dynamic_path')),
|
||||||
new Twig_SimpleFunction('*_foo_*_bar', array($this, 'dynamic_foo')),
|
new Twig_Function('*_foo_*_bar', array($this, 'dynamic_foo')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTests()
|
public function getTests()
|
||||||
{
|
{
|
||||||
return array(
|
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()
|
protected function getEnvironment()
|
||||||
{
|
{
|
||||||
$env = new Twig_Environment();
|
$env = new Twig_Environment();
|
||||||
$env->addFilter(new Twig_SimpleFilter('anonymous', function () {}));
|
$env->addFilter(new Twig_Filter('anonymous', function () {}));
|
||||||
|
|
||||||
return $env;
|
return $env;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase
|
|||||||
public function getTests()
|
public function getTests()
|
||||||
{
|
{
|
||||||
$environment = new Twig_Environment();
|
$environment = new Twig_Environment();
|
||||||
$environment->addFunction(new Twig_SimpleFunction('foo', 'foo', array()));
|
$environment->addFunction(new Twig_Function('foo', 'foo', array()));
|
||||||
$environment->addFunction(new Twig_SimpleFunction('bar', 'bar', array('needs_environment' => true)));
|
$environment->addFunction(new Twig_Function('bar', 'bar', array('needs_environment' => true)));
|
||||||
$environment->addFunction(new Twig_SimpleFunction('foofoo', 'foofoo', array('needs_context' => true)));
|
$environment->addFunction(new Twig_Function('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('foobar', 'foobar', array('needs_environment' => true, 'needs_context' => true)));
|
||||||
|
|
||||||
$tests = array();
|
$tests = array();
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase
|
|||||||
protected function getEnvironment()
|
protected function getEnvironment()
|
||||||
{
|
{
|
||||||
$env = new Twig_Environment();
|
$env = new Twig_Environment();
|
||||||
$env->addFunction(new Twig_SimpleFunction('anonymous', function () {}));
|
$env->addFunction(new Twig_Function('anonymous', function () {}));
|
||||||
|
|
||||||
return $env;
|
return $env;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Twig_Tests_Node_Expression_TestTest extends Twig_Test_NodeTestCase
|
|||||||
protected function getEnvironment()
|
protected function getEnvironment()
|
||||||
{
|
{
|
||||||
$env = new Twig_Environment();
|
$env = new Twig_Environment();
|
||||||
$env->addTest(new Twig_SimpleTest('anonymous', function () {}));
|
$env->addTest(new Twig_Test('anonymous', function () {}));
|
||||||
|
|
||||||
return $env;
|
return $env;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user