diff --git a/core/lib/Drupal/Core/Access/CheckProvider.php b/core/lib/Drupal/Core/Access/CheckProvider.php index 1587419a41177ae9543616bbdebd78268d8c7c7a..c68cf38a20fc19896304af09685dc3d489d4aa7e 100644 --- a/core/lib/Drupal/Core/Access/CheckProvider.php +++ b/core/lib/Drupal/Core/Access/CheckProvider.php @@ -3,14 +3,17 @@ namespace Drupal\Core\Access; use Drupal\Core\Routing\Access\AccessInterface; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; /** * Loads access checkers from the container. */ -class CheckProvider extends ContainerAware implements CheckProviderInterface { +class CheckProvider implements CheckProviderInterface, ContainerAwareInterface { + + use ContainerAwareTrait; /** * Array of registered access check service ids. diff --git a/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php index 67a40a6034bd80afb544d967a17d14d13ce48e70..db31384122b22045fd2870bc0e5bb5b9737c6a71 100644 --- a/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php @@ -3,7 +3,8 @@ namespace Drupal\Core\Cache\Context; use Drupal\Core\Cache\CacheableMetadata; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Defines the MenuActiveTrailsCacheContext service. @@ -11,7 +12,9 @@ * This class is container-aware to avoid initializing the 'menu.active_trails' * service (and its dependencies) when it is not necessary. */ -class MenuActiveTrailsCacheContext extends ContainerAware implements CalculatedCacheContextInterface { +class MenuActiveTrailsCacheContext implements CalculatedCacheContextInterface, ContainerAwareInterface { + + use ContainerAwareTrait; /** * {@inheritdoc} diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php index 8b9ee4e1e37f223af5e0b536f0ebfc3a1c58dd98..26b8eeecc9464e5a7e9f759fcceb9f6a685571e8 100644 --- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php +++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php @@ -2,14 +2,17 @@ namespace Drupal\Core\StreamWrapper; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Provides a StreamWrapper manager. * * @see \Drupal\Core\StreamWrapper\StreamWrapperInterface */ -class StreamWrapperManager extends ContainerAware implements StreamWrapperManagerInterface { +class StreamWrapperManager implements ContainerAwareInterface, StreamWrapperManagerInterface { + + use ContainerAwareTrait; /** * Contains stream wrapper info. diff --git a/core/modules/book/src/Cache/BookNavigationCacheContext.php b/core/modules/book/src/Cache/BookNavigationCacheContext.php index 4fe5ec14e91f15be7f85f3c30e7ac682755b150c..521d50bc496b947398d1f0bd62b21dcbfe655f5e 100644 --- a/core/modules/book/src/Cache/BookNavigationCacheContext.php +++ b/core/modules/book/src/Cache/BookNavigationCacheContext.php @@ -4,7 +4,8 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\Context\CacheContextInterface; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -19,7 +20,9 @@ * This class is container-aware to avoid initializing the 'book.manager' * service when it is not necessary. */ -class BookNavigationCacheContext extends ContainerAware implements CacheContextInterface { +class BookNavigationCacheContext implements CacheContextInterface, ContainerAwareInterface { + + use ContainerAwareTrait; /** * The request stack. diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php index fec4d4c5f4295c7c253684c00dcc3c15d81e5c08..98a18a354783551f25216979e42fe5520bfcd5bb 100644 --- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php +++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php @@ -14,7 +14,8 @@ use Drupal\Core\Routing\RouteMatch; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Tests\UnitTestCase; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; @@ -280,7 +281,8 @@ public function getResult() { } } -class MockContainerAware extends ContainerAware { +class MockContainerAware implements ContainerAwareInterface { + use ContainerAwareTrait; public function getResult() { return 'This is container aware.'; }