diff --git a/core/lib/Drupal/Core/Access/AccessManager.php b/core/lib/Drupal/Core/Access/AccessManager.php index 42fc39a..d957de8 100644 --- a/core/lib/Drupal/Core/Access/AccessManager.php +++ b/core/lib/Drupal/Core/Access/AccessManager.php @@ -16,7 +16,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Route; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Cmf\Component\Routing\RouteObjectInterface; @@ -26,7 +26,8 @@ * * @see \Drupal\Tests\Core\Access\AccessManagerTest */ -class AccessManager extends ContainerAware { +class AccessManager { + use ContainerAwareTrait; /** * Array of registered access check service ids. diff --git a/core/lib/Drupal/Core/Cache/CacheContexts.php b/core/lib/Drupal/Core/Cache/CacheContexts.php index 362069b..040c2f3 100644 --- a/core/lib/Drupal/Core/Cache/CacheContexts.php +++ b/core/lib/Drupal/Core/Cache/CacheContexts.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Cache; use Drupal\Core\Database\Query\SelectInterface; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Defines the CacheContexts service. @@ -16,8 +16,8 @@ * Converts string placeholders into their final string values, to be used as a * cache key. */ -class CacheContexts extends ContainerAware { - +class CacheContexts { + use ContainerAwareTrait; /** * Available cache contexts and corresponding labels. * diff --git a/core/lib/Drupal/Core/Cache/CacheFactory.php b/core/lib/Drupal/Core/Cache/CacheFactory.php index 7f061e5..e6513c1 100644 --- a/core/lib/Drupal/Core/Cache/CacheFactory.php +++ b/core/lib/Drupal/Core/Cache/CacheFactory.php @@ -11,10 +11,11 @@ * Defines the cache backend factory. */ use Drupal\Component\Utility\Settings; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerBuilder; -class CacheFactory extends ContainerAware implements CacheFactoryInterface { +class CacheFactory implements CacheFactoryInterface { + use ContainerAwareTrait; /** * The settings array. diff --git a/core/lib/Drupal/Core/Controller/AjaxController.php b/core/lib/Drupal/Core/Controller/AjaxController.php index 8d17397..c6636ce 100644 --- a/core/lib/Drupal/Core/Controller/AjaxController.php +++ b/core/lib/Drupal/Core/Controller/AjaxController.php @@ -8,13 +8,14 @@ namespace Drupal\Core\Controller; use Drupal\Core\Ajax\AjaxResponseRenderer; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Request; /** * Default controller for Ajax requests. */ -class AjaxController extends ContainerAware { +class AjaxController { + use ContainerAwareTrait; /** * The controller resolver. diff --git a/core/lib/Drupal/Core/Controller/ControllerResolver.php b/core/lib/Drupal/Core/Controller/ControllerResolver.php index 5e1cf48..eaa1623 100644 --- a/core/lib/Drupal/Core/Controller/ControllerResolver.php +++ b/core/lib/Drupal/Core/Controller/ControllerResolver.php @@ -11,6 +11,7 @@ use Symfony\Component\HttpKernel\Controller\ControllerResolver as BaseControllerResolver; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * ControllerResolver to enhance controllers beyond Symfony's basic handling. @@ -28,8 +29,7 @@ * convention). */ class ControllerResolver extends BaseControllerResolver implements ControllerResolverInterface { - - use \Symfony\Component\DependencyInjection\ContainerAwareTrait; + use ContainerAwareTrait; /** * The PSR-3 logger. (optional) diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index f091e01..7e3deb6 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -24,6 +24,7 @@ use Drupal\Core\Plugin\Discovery\InfoHookDecorator; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\TypedData\TranslatableInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Manages entity type plugin definitions. @@ -40,8 +41,7 @@ * @see hook_entity_type_alter() */ class EntityManager extends PluginManagerBase implements EntityManagerInterface { - - use \Symfony\Component\DependencyInjection\ContainerAwareTrait; + use ContainerAwareTrait; /** * Extra fields by bundle. diff --git a/core/lib/Drupal/Core/Entity/Query/QueryFactory.php b/core/lib/Drupal/Core/Entity/Query/QueryFactory.php index d046c87..f0d24ee 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryFactory.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryFactory.php @@ -8,12 +8,13 @@ namespace Drupal\Core\Entity\Query; use Drupal\Core\Entity\EntityManagerInterface; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Factory class Creating entity query objects. */ -class QueryFactory extends ContainerAware { +class QueryFactory { + use ContainerAwareTrait; /** * Stores the entity manager used by the query. diff --git a/core/lib/Drupal/Core/EventSubscriber/ContentFormControllerSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ContentFormControllerSubscriber.php index 4fc7111..2c528bc 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ContentFormControllerSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ContentFormControllerSubscriber.php @@ -13,13 +13,13 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Subscriber for setting wrapping form logic. */ -class ContentFormControllerSubscriber extends ContainerAware implements EventSubscriberInterface { +class ContentFormControllerSubscriber implements EventSubscriberInterface { + use ContainerAwareTrait; /** * The controller resolver. diff --git a/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php index e71f5ca..5309fa1 100644 --- a/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php @@ -7,7 +7,7 @@ namespace Drupal\Core\EventSubscriber; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; @@ -15,8 +15,8 @@ /** * Destructs services that are initiated and tagged with "needs_destruction". */ -class KernelDestructionSubscriber extends ContainerAware implements EventSubscriberInterface { - +class KernelDestructionSubscriber implements EventSubscriberInterface { + use ContainerAwareTrait; /** * Holds an array of service ID's that will require destruction. * diff --git a/core/lib/Drupal/Core/HttpKernel.php b/core/lib/Drupal/Core/HttpKernel.php index 198682f..b824419 100644 --- a/core/lib/Drupal/Core/HttpKernel.php +++ b/core/lib/Drupal/Core/HttpKernel.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernel as BaseHttpKernel; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * This HttpKernel is used to manage scope changes of the DI container. @@ -27,7 +28,7 @@ */ class HttpKernel extends BaseHttpKernel { - use \Symfony\Component\DependencyInjection\ContainerAwareTrait; + use ContainerAwareTrait; private $esiSupport; diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php index 38da9e5..0d68119 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php @@ -7,13 +7,13 @@ namespace Drupal\Core\KeyValueStore; use Drupal\Component\Utility\Settings; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Defines the key/value store factory. */ -class KeyValueFactory extends ContainerAware implements KeyValueFactoryInterface { - +class KeyValueFactory implements KeyValueFactoryInterface { + use ContainerAwareTrait; /** * The specific setting name prefix. * diff --git a/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php b/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php index 48f057b..1e53bd3 100644 --- a/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php +++ b/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php @@ -7,7 +7,7 @@ namespace Drupal\Core\ParamConverter; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\HttpFoundation\Request; @@ -18,7 +18,8 @@ * A typical use case for this would be upcasting (converting) a node id to a * node entity. */ -class ParamConverterManager extends ContainerAware implements ParamConverterManagerInterface { +class ParamConverterManager implements ParamConverterManagerInterface { + use ContainerAwareTrait; /** * An array of registered converter service ids. diff --git a/core/lib/Drupal/Core/Queue/QueueFactory.php b/core/lib/Drupal/Core/Queue/QueueFactory.php index 114123f..e2c256c 100644 --- a/core/lib/Drupal/Core/Queue/QueueFactory.php +++ b/core/lib/Drupal/Core/Queue/QueueFactory.php @@ -8,12 +8,13 @@ namespace Drupal\Core\Queue; use Drupal\Component\Utility\Settings; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Defines the queue factory. */ -class QueueFactory extends ContainerAware { +class QueueFactory { + use ContainerAwareTrait; /** * Instantiated queues, keyed by name. diff --git a/core/modules/contextual/lib/Drupal/contextual/ContextualController.php b/core/modules/contextual/lib/Drupal/contextual/ContextualController.php index aca277d..b881c77 100644 --- a/core/modules/contextual/lib/Drupal/contextual/ContextualController.php +++ b/core/modules/contextual/lib/Drupal/contextual/ContextualController.php @@ -7,7 +7,7 @@ namespace Drupal\contextual; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; @@ -16,7 +16,8 @@ /** * Returns responses for Contextual module routes. */ -class ContextualController extends ContainerAware { +class ContextualController { + use ContainerAwareTrait; /** * Returns the requested rendered contextual links. diff --git a/core/modules/rest/lib/Drupal/rest/RequestHandler.php b/core/modules/rest/lib/Drupal/rest/RequestHandler.php index 120ccfa..c78a940 100644 --- a/core/modules/rest/lib/Drupal/rest/RequestHandler.php +++ b/core/modules/rest/lib/Drupal/rest/RequestHandler.php @@ -8,7 +8,7 @@ namespace Drupal\rest; use Symfony\Cmf\Component\Routing\RouteObjectInterface; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; @@ -18,7 +18,8 @@ /** * Acts as intermediate request forwarder for resource plugins. */ -class RequestHandler extends ContainerAware { +class RequestHandler { + use ContainerAwareTrait; /** * Handles a web API request. diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index 7737cc8..64386e9 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -247,8 +247,8 @@ public function containerBuild(ContainerBuilder $container) { $container ->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueFactory') - ->addArgument(new Reference('service_container')) ->addArgument(new Reference('settings')); + $container->set('service_container', newReference('service_container')); $container->register('state', 'Drupal\Core\KeyValueStore\State') ->addArgument(new Reference('keyvalue')); diff --git a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php index d3676e0..38a7dbb 100644 --- a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php +++ b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php @@ -7,7 +7,7 @@ namespace Drupal\theme_test\EventSubscriber; -use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -15,7 +15,8 @@ /** * Theme test subscriber for controller requests. */ -class ThemeTestSubscriber extends ContainerAware implements EventSubscriberInterface { +class ThemeTestSubscriber implements EventSubscriberInterface { + use ContainerAwareTrait; /** * The used container.