Browse code

fixed some class names

Fabien Potencier authored on 15/02/2019 06:54:58
Showing 5 changed files
... ...
@@ -558,7 +558,7 @@ An extension is a class that implements the following interface::
558 558
          *
559 559
          * This is where you can load some file that contains filter functions for instance.
560 560
          *
561
-         * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
561
+         * @deprecated since 1.23 (to be removed in 2.0), implement \Twig\Extension\InitRuntimeInterface instead
562 562
          */
563 563
         function initRuntime(Twig_Environment $environment);
564 564
 
... ...
@@ -609,7 +609,7 @@ An extension is a class that implements the following interface::
609 609
          *
610 610
          * @return array An array of global variables
611 611
          *
612
-         * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
612
+         * @deprecated since 1.23 (to be removed in 2.0), implement \Twig\Extension\GlobalsInterface instead
613 613
          */
614 614
         function getGlobals();
615 615
 
... ...
@@ -288,7 +288,7 @@ All loaders implement the ``Twig_LoaderInterface``::
288 288
          *
289 289
          * @return string The template source code
290 290
          *
291
-         * @deprecated since 1.27 (to be removed in 2.0), implement Twig_SourceContextLoaderInterface
291
+         * @deprecated since 1.27 (to be removed in 2.0), implement \Twig\Loader\SourceContextLoaderInterface
292 292
          */
293 293
         function getSource($name);
294 294
 
... ...
@@ -92,10 +92,10 @@ Here is the output for the ``Hello {{ name }}`` template:
92 92
 
93 93
 .. code-block:: text
94 94
 
95
-    Twig_Node_Module(
96
-      Twig_Node_Text(Hello )
97
-      Twig_Node_Print(
98
-        Twig_Node_Expression_Name(name)
95
+    \Twig\Node\ModuleNode(
96
+      \Twig\Node\TextNode(Hello )
97
+      \Twig\Node\PrintNode(
98
+        \Twig\Node\Expression\NameExpression(name)
99 99
       )
100 100
     )
101 101
 
... ...
@@ -417,7 +417,7 @@ We have created a simple ``templates`` table that hosts two templates:
417 417
 
418 418
 Now, let's define a loader able to use this database::
419 419
 
420
-    class DatabaseTwigLoader implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
420
+    class DatabaseTwigLoader implements \Twig\Loader\LoaderInterface, \Twig\Loader\ExistsLoaderInterface, \Twig\Loader\SourceContextLoaderInterface
421 421
     {
422 422
         protected $dbh;
423 423
 
... ...
@@ -435,7 +435,7 @@ Now, let's define a loader able to use this database::
435 435
             return $source;
436 436
         }
437 437
 
438
-        // Twig_SourceContextLoaderInterface as of Twig 1.27
438
+        // \Twig\Loader\SourceContextLoaderInterface as of Twig 1.27
439 439
         public function getSourceContext($name)
440 440
         {
441 441
             if (false === $source = $this->getValue('source', $name)) {
... ...
@@ -445,7 +445,7 @@ Now, let's define a loader able to use this database::
445 445
             return new Twig_Source($source, $name);
446 446
         }
447 447
 
448
-        // Twig_ExistsLoaderInterface as of Twig 1.11
448
+        // \Twig\Loader\ExistsLoaderInterface as of Twig 1.11
449 449
         public function exists($name)
450 450
         {
451 451
             return $name === $this->getValue('name', $name);
... ...
@@ -67,7 +67,7 @@ class Twig_Extension_Escaper extends Twig_Extension
67 67
         }
68 68
 
69 69
         if ('name' === $defaultStrategy) {
70
-            $defaultStrategy = ['Twig_FileExtensionEscapingStrategy', 'guess'];
70
+            $defaultStrategy = ['\Twig\FileExtensionEscapingStrategy', 'guess'];
71 71
         }
72 72
 
73 73
         $this->defaultStrategy = $defaultStrategy;