summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2016-05-08 22:27:26 (GMT)
committerAlex Pott2016-05-08 22:27:26 (GMT)
commit2e5da97b7d060504821a7a02938f7cda6a0a549c (patch)
tree06819661f2e8e2bd7bffb5178d998a0c0b89d212
parentf324b3e358810ea8d9e8594757748f2cf4fb7a36 (diff)
Issue #2720891 by jan.stoeckler: Replace ContainerAware with ContainerAwareTrait
-rw-r--r--core/lib/Drupal/Core/Access/CheckProvider.php7
-rw-r--r--core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php7
-rw-r--r--core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php7
-rw-r--r--core/modules/book/src/Cache/BookNavigationCacheContext.php7
-rw-r--r--core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php6
5 files changed, 24 insertions, 10 deletions
diff --git a/core/lib/Drupal/Core/Access/CheckProvider.php b/core/lib/Drupal/Core/Access/CheckProvider.php
index 1587419..c68cf38 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 67a40a6..db31384 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 @@ use Symfony\Component\DependencyInjection\ContainerAware;
* 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 8b9ee4e..26b8eee 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 4fe5ec1..521d50b 100644
--- a/core/modules/book/src/Cache/BookNavigationCacheContext.php
+++ b/core/modules/book/src/Cache/BookNavigationCacheContext.php
@@ -4,7 +4,8 @@ namespace Drupal\book\Cache;
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 @@ use Symfony\Component\HttpFoundation\RequestStack;
* 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 fec4d4c..98a18a3 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\Entity\EntityInterface;
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 @@ class MockContainerInjection implements ContainerInjectionInterface {
}
}
-class MockContainerAware extends ContainerAware {
+class MockContainerAware implements ContainerAwareInterface {
+ use ContainerAwareTrait;
public function getResult() {
return 'This is container aware.';
}