From db751d62d35f5d4b2f10d360d460f9c67f1bf9dc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 15 Feb 2019 07:54:58 +0100 Subject: [PATCH] fixed some class names --- doc/advanced.rst | 4 ++-- doc/api.rst | 2 +- doc/internals.rst | 8 ++++---- doc/recipes.rst | 6 +++--- lib/Twig/Extension/Escaper.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/advanced.rst b/doc/advanced.rst index 2abde8416..7d05883f0 100644 --- a/doc/advanced.rst +++ b/doc/advanced.rst @@ -558,7 +558,7 @@ An extension is a class that implements the following interface:: * * This is where you can load some file that contains filter functions for instance. * - * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead + * @deprecated since 1.23 (to be removed in 2.0), implement \Twig\Extension\InitRuntimeInterface instead */ function initRuntime(Twig_Environment $environment); @@ -609,7 +609,7 @@ An extension is a class that implements the following interface:: * * @return array An array of global variables * - * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead + * @deprecated since 1.23 (to be removed in 2.0), implement \Twig\Extension\GlobalsInterface instead */ function getGlobals(); diff --git a/doc/api.rst b/doc/api.rst index 12e14b525..5852ee8c8 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -288,7 +288,7 @@ All loaders implement the ``Twig_LoaderInterface``:: * * @return string The template source code * - * @deprecated since 1.27 (to be removed in 2.0), implement Twig_SourceContextLoaderInterface + * @deprecated since 1.27 (to be removed in 2.0), implement \Twig\Loader\SourceContextLoaderInterface */ function getSource($name); diff --git a/doc/internals.rst b/doc/internals.rst index d81237973..c8e000ff1 100644 --- a/doc/internals.rst +++ b/doc/internals.rst @@ -92,10 +92,10 @@ Here is the output for the ``Hello {{ name }}`` template: .. code-block:: text - Twig_Node_Module( - Twig_Node_Text(Hello ) - Twig_Node_Print( - Twig_Node_Expression_Name(name) + \Twig\Node\ModuleNode( + \Twig\Node\TextNode(Hello ) + \Twig\Node\PrintNode( + \Twig\Node\Expression\NameExpression(name) ) ) diff --git a/doc/recipes.rst b/doc/recipes.rst index e62eee27e..b4208c482 100644 --- a/doc/recipes.rst +++ b/doc/recipes.rst @@ -417,7 +417,7 @@ We have created a simple ``templates`` table that hosts two templates: Now, let's define a loader able to use this database:: - class DatabaseTwigLoader implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface + class DatabaseTwigLoader implements \Twig\Loader\LoaderInterface, \Twig\Loader\ExistsLoaderInterface, \Twig\Loader\SourceContextLoaderInterface { protected $dbh; @@ -435,7 +435,7 @@ Now, let's define a loader able to use this database:: return $source; } - // Twig_SourceContextLoaderInterface as of Twig 1.27 + // \Twig\Loader\SourceContextLoaderInterface as of Twig 1.27 public function getSourceContext($name) { if (false === $source = $this->getValue('source', $name)) { @@ -445,7 +445,7 @@ Now, let's define a loader able to use this database:: return new Twig_Source($source, $name); } - // Twig_ExistsLoaderInterface as of Twig 1.11 + // \Twig\Loader\ExistsLoaderInterface as of Twig 1.11 public function exists($name) { return $name === $this->getValue('name', $name); diff --git a/lib/Twig/Extension/Escaper.php b/lib/Twig/Extension/Escaper.php index a4bf84488..b77eaad12 100644 --- a/lib/Twig/Extension/Escaper.php +++ b/lib/Twig/Extension/Escaper.php @@ -67,7 +67,7 @@ class Twig_Extension_Escaper extends Twig_Extension } if ('name' === $defaultStrategy) { - $defaultStrategy = ['Twig_FileExtensionEscapingStrategy', 'guess']; + $defaultStrategy = ['\Twig\FileExtensionEscapingStrategy', 'guess']; } $this->defaultStrategy = $defaultStrategy;