core/lib/Drupal/Core/CoreServiceProvider.php | 2 +- .../Core/DependencyInjection/Compiler/TwigExtensionPass.php | 4 +++- core/lib/Drupal/Core/Template/TwigEnvironment.php | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php index 3d1b350..7b83fc2 100644 --- a/core/lib/Drupal/Core/CoreServiceProvider.php +++ b/core/lib/Drupal/Core/CoreServiceProvider.php @@ -79,7 +79,7 @@ public function register(ContainerBuilder $container) { $container->addCompilerPass(new RegisterStreamWrappersPass()); $container->addCompilerPass(new GuzzleMiddlewarePass()); - $this->addCompilerPass(new TwigExtensionPass()); + $container->addCompilerPass(new TwigExtensionPass()); // Add a compiler pass for registering event subscribers. $container->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING); diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php index f7ac226..35dd690 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php @@ -11,7 +11,9 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * Adds a hash of all extensions for twig template invalidation. + * Adds twig_extension_hash parameter to the container. + * + * A hash of all extensions for Twig template invalidation. */ class TwigExtensionPass implements CompilerPassInterface { diff --git a/core/lib/Drupal/Core/Template/TwigEnvironment.php b/core/lib/Drupal/Core/Template/TwigEnvironment.php index fbc14bf..b86a40a 100644 --- a/core/lib/Drupal/Core/Template/TwigEnvironment.php +++ b/core/lib/Drupal/Core/Template/TwigEnvironment.php @@ -31,7 +31,7 @@ class TwigEnvironment extends \Twig_Environment { protected $cache_object = NULL; /** - * The phpstorage object used for storing the templates. + * The PhpStorage object used for storing the templates. * * @var \Drupal\Core\PhpStorage\PhpStorageFactory */ @@ -52,7 +52,7 @@ class TwigEnvironment extends \Twig_Environment { protected $templateClasses; /** - * The twig extension hash, which is used to invalidate twig templates. + * The Twig extension hash, which is used to invalidate Twig templates. * * @var string */ @@ -67,7 +67,7 @@ class TwigEnvironment extends \Twig_Environment { * @param \Drupal\Core\Cache\CacheBackendInterface $cache * The cache bin. * @param string $twig_extension_hash - * The twig extension hash. + * The Twig extension hash. * @param \Twig_LoaderInterface $loader * The Twig loader or loader chain. * @param array $options @@ -123,8 +123,8 @@ public function updateCompiledTemplate($cache_filename, $name) { */ public function getCacheFilename($name) { // We override the cache filename in order to avoid issues with not using - // shared filesystems. The twig templates for example rely on available - // twig extensions, so we need to take into account the \Drupal::VERSION + // shared filesystems. The Twig templates for example rely on available Twig + // extensions, so we need to take into account the \Drupal::VERSION // deployment identifier, much like for the container itself. if (!$this->cache) {