added soe missing deprecations

This commit is contained in:
Fabien Potencier
2019-03-05 11:51:00 +01:00
parent 2d52000798
commit 379f0c3553
9 changed files with 39 additions and 2 deletions
+4 -2
View File
@@ -1,12 +1,14 @@
* 2.7.0 (2019-XX-XX)
* deprecated Twig\Extension\InitRuntimeInterface
* deprecated Twig\Loader\ExistsLoaderInterface
* deprecated PSR-0 classes in favor of namespaced ones
* made namespace classes the default classes (PSR-0 ones are aliases now)
* added Twig\Loader\ChainLoader::getLoaders()
* removed duplicated directory separator in FilesystemLoader
* deprecated the "base_template_class" option on Twig\Environment
* deprecated the ``Twig\Environment::getBaseTemplateClass()`` and
``Twig\Environment::setBaseTemplateClass()`` methods
* deprecated the Twig\Environment::getBaseTemplateClass() and
Twig\Environment::setBaseTemplateClass() methods
* changed internal code to use the namespaced classes as much as possible
* deprecated Twig_Parser::isReservedMacroName()
+17
View File
@@ -60,3 +60,20 @@ Environment
* As of Twig 2.7, the ``Twig\Environment::getBaseTemplateClass()`` and
``Twig\Environment::setBaseTemplateClass()`` methods are deprecated and will
be removed in Twig 3.0.
Interfaces
----------
* As of Twig 2.7, the empty ``Twig\Loader\ExistsLoaderInterface`` interface is
deprecated and will be removed in Twig 3.0.
* As of Twig 2.7, the ``Twig\Extension\InitRuntimeInterface`` interface is
deprecated and will be removed in Twig 3.0.
Miscellaneous
-------------
* As of Twig 2.7, the ``Twig_SimpleFilter``, ``Twig_SimpleFunction``, and
``Twig_SimpleTest`` empty classes are deprecated and will be removed in Twig
3.0. Use ``Twig\TwigFilter``, ``Twig\TwigFunction``, and ``Twig\TwigTest``
respectively.
+3
View File
@@ -16,7 +16,10 @@ use Twig\TwigFilter;
*/
class_exists(TwigFilter::class);
@trigger_error(sprintf('Using the "Twig_SimpleFilter" class is deprecated since Twig version 2.7, use "Twig\TwigFilter" instead.'), E_USER_DEPRECATED);
if (false) {
/** @deprecated since Twig 2.7, use "Twig\TwigFilter" instead */
final class Twig_SimpleFilter extends TwigFilter
{
}
+3
View File
@@ -16,7 +16,10 @@ use Twig\TwigFunction;
*/
class_exists(TwigFunction::class);
@trigger_error(sprintf('Using the "Twig_SimpleFunction" class is deprecated since Twig version 2.7, use "Twig\TwigFunction" instead.'), E_USER_DEPRECATED);
if (false) {
/** @deprecated since Twig 2.7, use "Twig\TwigFunction" instead */
final class Twig_SimpleFunction extends TwigFunction
{
}
+3
View File
@@ -16,7 +16,10 @@ use Twig\TwigTest;
*/
class_exists(TwigTest::class);
@trigger_error(sprintf('Using the "Twig_SimpleTest" class is deprecated since Twig version 2.7, use "Twig\TwigTest" instead.'), E_USER_DEPRECATED);
if (false) {
/** @deprecated since Twig 2.7, use "Twig\TwigTest" instead */
final class Twig_SimpleTest extends TwigTest
{
}
+2
View File
@@ -20,6 +20,8 @@ use Twig\Environment;
* deprecated initRuntime() method in your extensions.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since version 2.7, to be removed in 3.0
*/
interface InitRuntimeInterface
{
+2
View File
@@ -60,6 +60,8 @@ final class ExtensionSet
foreach ($this->extensions as $extension) {
if ($extension instanceof InitRuntimeInterface) {
@trigger_error(sprintf('Implementing \Twig\Extension\InitRuntimeInterface on "%s" is deprecated since Twig 2.7 as the interface will be removed in 3.0.', get_class($extension)), E_USER_DEPRECATED);
$extension->initRuntime($env);
}
}
+2
View File
@@ -13,6 +13,8 @@ namespace Twig\Loader;
/**
* Empty interface for Twig 1.x compatibility.
*
* @deprecated since version 2.7, to be removed in 3.0
*/
interface ExistsLoaderInterface extends LoaderInterface
{
+3
View File
@@ -308,6 +308,9 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($twig->isTemplateFresh('page', time()));
}
/**
* @group legacy
*/
public function testInitRuntimeWithAnExtensionUsingInitRuntimeNoDeprecation()
{
$loader = $this->getMockBuilder(LoaderInterface::class)->getMock();