.../EarlyRenderingControllerWrapperSubscriber.php | 14 +++++--------- core/modules/system/src/Tests/Common/UrlTest.php | 1 - .../src/AttachmentsTestResponse.php | 1 - .../src/EarlyRenderingTestController.php | 2 -- core/modules/views/src/Tests/Plugin/CacheTest.php | 4 ++-- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php index 8abb662..5f8948f 100644 --- a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php @@ -7,7 +7,6 @@ namespace Drupal\Core\EventSubscriber; -use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Cache\CacheableResponseInterface; use Drupal\Core\Controller\ControllerResolverInterface; use Drupal\Core\Render\AttachmentsInterface; @@ -32,8 +31,7 @@ * cache contexts causing a cached page not to be varied sufficiently). * * This event subscriber wraps all controller executions in a closure that sets - * up a render context. Consequently, any early rendering (i.e. drupal_render() - * invocations during the actual controller's execution) will have their + * up a render context. Consequently, any early rendering will have their * bubbleable metadata (assets & cacheability) stored on that render context. * * If the render context is empty, then the controller either did not do any @@ -41,10 +39,8 @@ * ::renderPlain() methods. In that case, no bubbleable metadata is lost. * * If the render context is not empty, then the controller did use - * drupal_render(), and bubbleable metadata was collected. Without this - * subscriber, that bubbleable metadata would have been lost. But since it is - * collected by this subscriber, this bubbleable metadata can be merged onto the - * render array. Disaster averted. + * drupal_render(), and bubbleable metadata was collected. This bubbleable + * metadata is then merged onto the render array. * * In other words: this just exists to ease the transition to Drupal 8: it * allows controllers that return render arrays (the majority) to still do early @@ -99,7 +95,7 @@ public function onController(FilterControllerEvent $event) { $arguments = $this->controllerResolver->getArguments($event->getRequest(), $controller); $event->setController(function() use ($controller, $arguments) { - return $this->wrapControllerExcecutionInRenderContext($controller, $arguments); + return $this->wrapControllerExecutionInRenderContext($controller, $arguments); }); } @@ -119,7 +115,7 @@ public function onController(FilterControllerEvent $event) { * * @see \Symfony\Component\HttpKernel\HttpKernel::handleRaw() */ - protected function wrapControllerExcecutionInRenderContext($controller, array $arguments) { + protected function wrapControllerExecutionInRenderContext($controller, array $arguments) { $context = new RenderContext(); $response = $this->renderer->executeInRenderContext($context, function() use ($controller, $arguments) { diff --git a/core/modules/system/src/Tests/Common/UrlTest.php b/core/modules/system/src/Tests/Common/UrlTest.php index 705e191..1a26232 100644 --- a/core/modules/system/src/Tests/Common/UrlTest.php +++ b/core/modules/system/src/Tests/Common/UrlTest.php @@ -9,7 +9,6 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Cache\Cache; -use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Language\Language; use Drupal\Core\Render\RenderContext; use Drupal\Core\Url; diff --git a/core/modules/system/tests/modules/early_rendering_controller_test/src/AttachmentsTestResponse.php b/core/modules/system/tests/modules/early_rendering_controller_test/src/AttachmentsTestResponse.php index f8d040e..2b81f02 100644 --- a/core/modules/system/tests/modules/early_rendering_controller_test/src/AttachmentsTestResponse.php +++ b/core/modules/system/tests/modules/early_rendering_controller_test/src/AttachmentsTestResponse.php @@ -7,7 +7,6 @@ namespace Drupal\early_rendering_controller_test; -use Drupal\Core\Cache\CacheableResponseTrait; use Drupal\Core\Render\AttachmentsInterface; use Drupal\Core\Render\AttachmentsTrait; use Symfony\Component\HttpFoundation\Response; diff --git a/core/modules/system/tests/modules/early_rendering_controller_test/src/EarlyRenderingTestController.php b/core/modules/system/tests/modules/early_rendering_controller_test/src/EarlyRenderingTestController.php index fb683c8..5d6bb7f 100644 --- a/core/modules/system/tests/modules/early_rendering_controller_test/src/EarlyRenderingTestController.php +++ b/core/modules/system/tests/modules/early_rendering_controller_test/src/EarlyRenderingTestController.php @@ -7,10 +7,8 @@ namespace Drupal\early_rendering_controller_test; -use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Render\RendererInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; diff --git a/core/modules/views/src/Tests/Plugin/CacheTest.php b/core/modules/views/src/Tests/Plugin/CacheTest.php index 0e54bbc..0d8c907 100644 --- a/core/modules/views/src/Tests/Plugin/CacheTest.php +++ b/core/modules/views/src/Tests/Plugin/CacheTest.php @@ -284,7 +284,7 @@ function testHeaderStorage() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = \Drupal::service('renderer'); $renderer->executeInRenderContext(new RenderContext(), function () use (&$output, $renderer) { - return $renderer->render($output);; + return $renderer->render($output); }); unset($view->pre_render_called); @@ -293,7 +293,7 @@ function testHeaderStorage() { $view->setDisplay(); $output = $view->buildRenderable(); $renderer->executeInRenderContext(new RenderContext(), function () use (&$output, $renderer) { - return $renderer->render($output);; + return $renderer->render($output); }); $this->assertTrue(in_array('views_test_data/test', $output['#attached']['library']), 'Make sure libraries are added for cached views.');