Skip to content
Snippets Groups Projects
Verified Commit 6f006991 authored by Dave Long's avatar Dave Long
Browse files

Issue #3397581 by Spokje: Remove ContainerAware classes from RenderPlaceholderMessageTestController

parent 66716dc9
No related branches found
No related tags found
No related merge requests found
services:
render_placeholder_message_test.controller:
class: Drupal\render_placeholder_message_test\RenderPlaceholderMessageTestController
arguments: ['@renderer']
......@@ -2,14 +2,31 @@
namespace Drupal\render_placeholder_message_test;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Security\TrustedCallbackInterface;
use Drupal\Core\Render\RenderContext;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;
class RenderPlaceholderMessageTestController implements ContainerAwareInterface, TrustedCallbackInterface {
class RenderPlaceholderMessageTestController implements TrustedCallbackInterface, ContainerInjectionInterface {
use ContainerAwareTrait;
/**
* Constructs a new RenderPlaceholderMessageTestController object.
*
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer service.
*/
public function __construct(protected RendererInterface $renderer) {
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('renderer'),
);
}
/**
* @return array
......@@ -72,8 +89,7 @@ protected function build(array $placeholder_order) {
'#create_placeholder' => TRUE,
];
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$renderer = $this->renderer;
$renderer->executeInRenderContext(new RenderContext(), function () use (&$build, $renderer) {
return $renderer->render($build, FALSE);
});
......
......@@ -2341,22 +2341,6 @@ parameters:
count: 1
path: modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php
-
message: """
#^Class Drupal\\\\render_placeholder_message_test\\\\RenderPlaceholderMessageTestController implements deprecated interface Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\:
since Symfony 6\\.4, use dependency injection instead$#
"""
count: 1
path: modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php
-
message: """
#^Usage of deprecated trait Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareTrait in class Drupal\\\\render_placeholder_message_test\\\\RenderPlaceholderMessageTestController\\:
since Symfony 6\\.4, use dependency injection instead$#
"""
count: 1
path: modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php
-
message: """
#^Class Drupal\\\\service_provider_test\\\\TestClass implements deprecated interface Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment