summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2015-06-16 13:51:07 -0500
committerxjm2015-06-16 13:51:07 -0500
commit8305be48fcb622b74053e8cc2cfc58af0a29977e (patch)
treef54586a925bca425ae40d767b7cea4da0fc85855
parent41560b32962e0d36fe5da246f3bb6912e36e08c3 (diff)
Issue #2483781 by borisson_, rbayliss, cilefen, mitalimehta, joshi.rohit100: Move cache contexts classes from \Drupal\Core\Cache to \Drupal\Core\Cache\Context
-rw-r--r--core/core.services.yml38
-rw-r--r--core/lib/Drupal/Core/Access/AccessResult.php4
-rw-r--r--core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php2
-rw-r--r--core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php (renamed from core/lib/Drupal/Core/Cache/AccountPermissionsCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php (renamed from core/lib/Drupal/Core/Cache/CacheContextInterface.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php (renamed from core/lib/Drupal/Core/Cache/CacheContextsManager.php)14
-rw-r--r--core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php (renamed from core/lib/Drupal/Core/Cache/CacheContextsPass.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php (renamed from core/lib/Drupal/Core/Cache/CalculatedCacheContextInterface.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php (renamed from core/lib/Drupal/Core/Cache/CookiesCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php (renamed from core/lib/Drupal/Core/Cache/HeadersCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/IpCacheContext.php (renamed from core/lib/Drupal/Core/Cache/IpCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php (renamed from core/lib/Drupal/Core/Cache/IsSuperUserCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php (renamed from core/lib/Drupal/Core/Cache/LanguagesCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php (renamed from core/lib/Drupal/Core/Cache/MenuActiveTrailsCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php (renamed from core/lib/Drupal/Core/Cache/PagersCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php (renamed from core/lib/Drupal/Core/Cache/QueryArgsCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php (renamed from core/lib/Drupal/Core/Cache/RequestFormatCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php (renamed from core/lib/Drupal/Core/Cache/RequestStackCacheContextBase.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php (renamed from core/lib/Drupal/Core/Cache/RouteCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php (renamed from core/lib/Drupal/Core/Cache/RouteNameCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php (renamed from core/lib/Drupal/Core/Cache/SiteCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php (renamed from core/lib/Drupal/Core/Cache/ThemeCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php (renamed from core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php (renamed from core/lib/Drupal/Core/Cache/UrlCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/UserCacheContext.php (renamed from core/lib/Drupal/Core/Cache/UserCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php (renamed from core/lib/Drupal/Core/Cache/UserRolesCacheContext.php)4
-rw-r--r--core/lib/Drupal/Core/CoreServiceProvider.php2
-rw-r--r--core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php6
-rw-r--r--core/lib/Drupal/Core/Render/RenderCache.php6
-rw-r--r--core/modules/block/src/Tests/BlockViewBuilderTest.php2
-rw-r--r--core/modules/book/src/Cache/BookNavigationCacheContext.php2
-rw-r--r--core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php2
-rw-r--r--core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php4
-rw-r--r--core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php2
-rw-r--r--core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php2
-rw-r--r--core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php (renamed from core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php)10
-rw-r--r--core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererTestBase.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php2
41 files changed, 98 insertions, 98 deletions
diff --git a/core/core.services.yml b/core/core.services.yml
index 77173cd..5a9cd6e 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -10,59 +10,59 @@ parameters:
services:
# Simple cache contexts, directly derived from the request context.
cache_context.ip:
- class: Drupal\Core\Cache\IpCacheContext
+ class: Drupal\Core\Cache\Context\IpCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.headers:
- class: Drupal\Core\Cache\HeadersCacheContext
+ class: Drupal\Core\Cache\Context\HeadersCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.cookies:
- class: Drupal\Core\Cache\CookiesCacheContext
+ class: Drupal\Core\Cache\Context\CookiesCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.request_format:
- class: Drupal\Core\Cache\RequestFormatCacheContext
+ class: Drupal\Core\Cache\Context\RequestFormatCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.url:
- class: Drupal\Core\Cache\UrlCacheContext
+ class: Drupal\Core\Cache\Context\UrlCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.url.site:
- class: Drupal\Core\Cache\SiteCacheContext
+ class: Drupal\Core\Cache\Context\SiteCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.url.query_args:
- class: Drupal\Core\Cache\QueryArgsCacheContext
+ class: Drupal\Core\Cache\Context\QueryArgsCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
cache_context.url.query_args.pagers:
- class: Drupal\Core\Cache\PagersCacheContext
+ class: Drupal\Core\Cache\Context\PagersCacheContext
arguments: ['@request_stack']
tags:
- { name: cache.context }
# Complex cache contexts, that depend on the routing system.
cache_context.route:
- class: Drupal\Core\Cache\RouteCacheContext
+ class: Drupal\Core\Cache\Context\RouteCacheContext
arguments: ['@current_route_match']
tags:
- { name: cache.context }
cache_context.route.name:
- class: Drupal\Core\Cache\RouteNameCacheContext
+ class: Drupal\Core\Cache\Context\RouteNameCacheContext
arguments: ['@current_route_match']
tags:
- { name: cache.context }
cache_context.route.menu_active_trails:
- class: Drupal\Core\Cache\MenuActiveTrailsCacheContext
+ class: Drupal\Core\Cache\Context\MenuActiveTrailsCacheContext
calls:
- [setContainer, ['@service_container']]
tags:
@@ -72,37 +72,37 @@ services:
# multiple aspects of the request context plus additional logic. Hence they
# are their own roots.
cache_context.user:
- class: Drupal\Core\Cache\UserCacheContext
+ class: Drupal\Core\Cache\Context\UserCacheContext
arguments: ['@current_user']
tags:
- { name: cache.context}
cache_context.user.permissions:
- class: Drupal\Core\Cache\AccountPermissionsCacheContext
+ class: Drupal\Core\Cache\Context\AccountPermissionsCacheContext
arguments: ['@current_user', '@user_permissions_hash_generator']
tags:
- { name: cache.context}
cache_context.user.roles:
- class: Drupal\Core\Cache\UserRolesCacheContext
+ class: Drupal\Core\Cache\Context\UserRolesCacheContext
arguments: ['@current_user']
tags:
- { name: cache.context}
cache_context.user.is_super_user:
- class: Drupal\Core\Cache\IsSuperUserCacheContext
+ class: Drupal\Core\Cache\Context\IsSuperUserCacheContext
arguments: ['@current_user']
tags:
- { name: cache.context}
cache_context.languages:
- class: Drupal\Core\Cache\LanguagesCacheContext
+ class: Drupal\Core\Cache\Context\LanguagesCacheContext
arguments: ['@language_manager']
tags:
- { name: cache.context}
cache_context.theme:
- class: Drupal\Core\Cache\ThemeCacheContext
+ class: Drupal\Core\Cache\Context\ThemeCacheContext
arguments: ['@theme.manager']
tags:
- { name: cache.context}
cache_context.timezone:
- class: Drupal\Core\Cache\TimeZoneCacheContext
+ class: Drupal\Core\Cache\Context\TimeZoneCacheContext
tags:
- { name: cache.context}
@@ -112,7 +112,7 @@ services:
calls:
- [setContainer, ['@service_container']]
cache_contexts_manager:
- class: Drupal\Core\Cache\CacheContextsManager
+ class: Drupal\Core\Cache\Context\CacheContextsManager
arguments: ['@service_container', '%cache_contexts%' ]
cache_tags.invalidator:
parent: container.trait
diff --git a/core/lib/Drupal/Core/Access/AccessResult.php b/core/lib/Drupal/Core/Access/AccessResult.php
index 24d5051..9c4e42f 100644
--- a/core/lib/Drupal/Core/Access/AccessResult.php
+++ b/core/lib/Drupal/Core/Access/AccessResult.php
@@ -31,8 +31,8 @@ abstract class AccessResult implements AccessResultInterface, CacheableDependenc
/**
* The cache context IDs (to vary a cache item ID based on active contexts).
*
- * @see \Drupal\Core\Cache\CacheContextInterface
- * @see \Drupal\Core\Cache\CacheContextsManager::convertTokensToKeys()
+ * @see \Drupal\Core\Cache\Context\CacheContextInterface
+ * @see \Drupal\Core\Cache\Context\CacheContextsManager::convertTokensToKeys()
*
* @var string[]
*/
diff --git a/core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php b/core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php
index f415064..ee1241b 100644
--- a/core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php
+++ b/core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php
@@ -31,7 +31,7 @@ interface CacheableDependencyInterface {
* @return string[]
* An array of cache context tokens, used to generate a cache ID.
*
- * @see \Drupal\Core\Cache\CacheContextsManager::convertTokensToKeys()
+ * @see \Drupal\Core\Cache\Context\CacheContextsManager::convertTokensToKeys()
*/
public function getCacheContexts();
diff --git a/core/lib/Drupal/Core/Cache/AccountPermissionsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php
index 3352eca..7afce73 100644
--- a/core/lib/Drupal/Core/Cache/AccountPermissionsCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\UserRolesCacheContext.
+ * Contains \Drupal\Core\Cache\Context\UserRolesCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\PermissionsHashGeneratorInterface;
diff --git a/core/lib/Drupal/Core/Cache/CacheContextInterface.php b/core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php
index fd9783a..ada3174 100644
--- a/core/lib/Drupal/Core/Cache/CacheContextInterface.php
+++ b/core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\CacheContextInterface.
+ * Contains \Drupal\Core\Cache\Context\CacheContextInterface.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Provides an interface for defining a cache context service.
diff --git a/core/lib/Drupal/Core/Cache/CacheContextsManager.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
index 67857cb..27b012a 100644
--- a/core/lib/Drupal/Core/Cache/CacheContextsManager.php
+++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\CacheContextsManager.
+ * Contains \Drupal\Core\Cache\Context\CacheContextsManager.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Drupal\Component\Utility\SafeMarkup;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -21,9 +21,9 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* Note that this maps exactly to HTTP's Vary header semantics:
* @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44
*
- * @see \Drupal\Core\Cache\CacheContextInterface
- * @see \Drupal\Core\Cache\CalculatedCacheContextInterface
- * @see \Drupal\Core\Cache\CacheContextsPass
+ * @see \Drupal\Core\Cache\Context\CacheContextInterface
+ * @see \Drupal\Core\Cache\Context\CalculatedCacheContextInterface
+ * @see \Drupal\Core\Cache\Context\CacheContextsPass
*/
class CacheContextsManager {
@@ -188,7 +188,7 @@ class CacheContextsManager {
* The context ID, which together with the service ID prefix allows the
* corresponding cache context service to be retrieved.
*
- * @return \Drupal\Core\Cache\CacheContextInterface
+ * @return \Drupal\Core\Cache\Context\CacheContextInterface
* The requested cache context service.
*/
protected function getService($context_id) {
@@ -231,7 +231,7 @@ class CacheContextsManager {
*
* @throws \LogicException
*
- * @see \Drupal\Core\Cache\CacheContextsManager::parseTokens()
+ * @see \Drupal\Core\Cache\Context\CacheContextsManager::parseTokens()
*/
public function validateTokens(array $context_tokens = []) {
if (empty($context_tokens)) {
diff --git a/core/lib/Drupal/Core/Cache/CacheContextsPass.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php
index 576b2b5..ce8e2f4 100644
--- a/core/lib/Drupal/Core/Cache/CacheContextsPass.php
+++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\CacheContextsPass.
+ * Contains \Drupal\Core\Cache\Context\CacheContextsPass.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
diff --git a/core/lib/Drupal/Core/Cache/CalculatedCacheContextInterface.php b/core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php
index 38114c3..4242109 100644
--- a/core/lib/Drupal/Core/Cache/CalculatedCacheContextInterface.php
+++ b/core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\CacheContextInterface.
+ * Contains \Drupal\Core\Cache\Context\CacheContextInterface.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Provides an interface for defining a calculated cache context service.
diff --git a/core/lib/Drupal/Core/Cache/CookiesCacheContext.php b/core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php
index 6760b1b..e7850b8 100644
--- a/core/lib/Drupal/Core/Cache/CookiesCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\CookiesCacheContext.
+ * Contains \Drupal\Core\Cache\Context\CookiesCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the CookiesCacheContext service, for "per cookie" caching.
diff --git a/core/lib/Drupal/Core/Cache/HeadersCacheContext.php b/core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php
index e2b8932..1644aa0 100644
--- a/core/lib/Drupal/Core/Cache/HeadersCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\HeadersCacheContext.
+ * Contains \Drupal\Core\Cache\Context\HeadersCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the HeadersCacheContext service, for "per header" caching.
diff --git a/core/lib/Drupal/Core/Cache/IpCacheContext.php b/core/lib/Drupal/Core/Cache/Context/IpCacheContext.php
index c0c2e08..4841482 100644
--- a/core/lib/Drupal/Core/Cache/IpCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/IpCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\IpCacheContext.
+ * Contains \Drupal\Core\Cache\Context\IpCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the IpCacheContext service, for "per IP address" caching.
diff --git a/core/lib/Drupal/Core/Cache/IsSuperUserCacheContext.php b/core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php
index 6569715..3f27059 100644
--- a/core/lib/Drupal/Core/Cache/IsSuperUserCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\IsSuperUserCacheContext.
+ * Contains \Drupal\Core\Cache\Context\IsSuperUserCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the IsSuperUserCacheContext service, for "super user or not" caching.
diff --git a/core/lib/Drupal/Core/Cache/LanguagesCacheContext.php b/core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php
index b9b8883..2bf9a2f 100644
--- a/core/lib/Drupal/Core/Cache/LanguagesCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\LanguagesCacheContext.
+ * Contains \Drupal\Core\Cache\Context\LanguagesCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Drupal\Core\Language\LanguageManagerInterface;
diff --git a/core/lib/Drupal/Core/Cache/MenuActiveTrailsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php
index 3b43178..40cc077 100644
--- a/core/lib/Drupal/Core/Cache/MenuActiveTrailsCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\MenuActiveTrailsCacheContext.
+ * Contains \Drupal\Core\Cache\Context\MenuActiveTrailsCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Symfony\Component\DependencyInjection\ContainerAware;
diff --git a/core/lib/Drupal/Core/Cache/PagersCacheContext.php b/core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php
index cd9bb98..23bdb7c 100644
--- a/core/lib/Drupal/Core/Cache/PagersCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\PagersCacheContext.
+ * Contains \Drupal\Core\Cache\Context\PagersCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines a cache context for "per page in a pager" caching.
diff --git a/core/lib/Drupal/Core/Cache/QueryArgsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php
index 4c34721..e9a7664 100644
--- a/core/lib/Drupal/Core/Cache/QueryArgsCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\QueryArgsCacheContext.
+ * Contains \Drupal\Core\Cache\Context\QueryArgsCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the QueryArgsCacheContext service, for "per query args" caching.
diff --git a/core/lib/Drupal/Core/Cache/RequestFormatCacheContext.php b/core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php
index 397384f..c3e544d 100644
--- a/core/lib/Drupal/Core/Cache/RequestFormatCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\RequestFormatCacheContext.
+ * Contains \Drupal\Core\Cache\Context\RequestFormatCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the RequestFormatCacheContext service, for "per format" caching.
diff --git a/core/lib/Drupal/Core/Cache/RequestStackCacheContextBase.php b/core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php
index 34e3560..2a8f22d 100644
--- a/core/lib/Drupal/Core/Cache/RequestStackCacheContextBase.php
+++ b/core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\RequestStackCacheContextBase.
+ * Contains \Drupal\Core\Cache\Context\RequestStackCacheContextBase.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Symfony\Component\HttpFoundation\RequestStack;
diff --git a/core/lib/Drupal/Core/Cache/RouteCacheContext.php b/core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php
index 486cdef..0643d8b 100644
--- a/core/lib/Drupal/Core/Cache/RouteCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\RouteCacheContext.
+ * Contains \Drupal\Core\Cache\Context\RouteCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Drupal\Core\Routing\RouteMatchInterface;
diff --git a/core/lib/Drupal/Core/Cache/RouteNameCacheContext.php b/core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php
index f0bd937..dcca18b 100644
--- a/core/lib/Drupal/Core/Cache/RouteNameCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\RouteNameCacheContext.
+ * Contains \Drupal\Core\Cache\Context\RouteNameCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the RouteCacheContext service, for "per route name" caching.
diff --git a/core/lib/Drupal/Core/Cache/SiteCacheContext.php b/core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php
index febbc0e..4e0c123 100644
--- a/core/lib/Drupal/Core/Cache/SiteCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\SiteCacheContext.
+ * Contains \Drupal\Core\Cache\Context\SiteCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the SiteCacheContext service, for "per site" caching.
diff --git a/core/lib/Drupal/Core/Cache/ThemeCacheContext.php b/core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php
index ad0249a..5f478ec 100644
--- a/core/lib/Drupal/Core/Cache/ThemeCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\LanguageCacheContext.
+ * Contains \Drupal\Core\Cache\Context\LanguageCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeManagerInterface;
diff --git a/core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php b/core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php
index ae0621c..7e5b7c5 100644
--- a/core/lib/Drupal/Core/Cache/TimeZoneCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\TimeZoneCacheContext.
+ * Contains \Drupal\Core\Cache\Context\TimeZoneCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the TimeZoneCacheContext service, for "per time zone" caching.
diff --git a/core/lib/Drupal/Core/Cache/UrlCacheContext.php b/core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php
index 1381093..1ea0bf0 100644
--- a/core/lib/Drupal/Core/Cache/UrlCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\UrlCacheContext.
+ * Contains \Drupal\Core\Cache\Context\UrlCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the UrlCacheContext service, for "per page" caching.
diff --git a/core/lib/Drupal/Core/Cache/UserCacheContext.php b/core/lib/Drupal/Core/Cache/Context/UserCacheContext.php
index d5e2825..80ad519 100644
--- a/core/lib/Drupal/Core/Cache/UserCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/UserCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\UserCacheContext.
+ * Contains \Drupal\Core\Cache\Context\UserCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
use Drupal\Core\Session\AccountInterface;
diff --git a/core/lib/Drupal/Core/Cache/UserRolesCacheContext.php b/core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php
index cf7b450..375d80b 100644
--- a/core/lib/Drupal/Core/Cache/UserRolesCacheContext.php
+++ b/core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php
@@ -2,10 +2,10 @@
/**
* @file
- * Contains \Drupal\Core\Cache\UserRolesCacheContext.
+ * Contains \Drupal\Core\Cache\Context\UserRolesCacheContext.
*/
-namespace Drupal\Core\Cache;
+namespace Drupal\Core\Cache\Context;
/**
* Defines the UserRolesCacheContext service, for "per role" caching.
diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php
index 75d8ec5..64a9aee 100644
--- a/core/lib/Drupal/Core/CoreServiceProvider.php
+++ b/core/lib/Drupal/Core/CoreServiceProvider.php
@@ -7,7 +7,7 @@
namespace Drupal\Core;
-use Drupal\Core\Cache\CacheContextsPass;
+use Drupal\Core\Cache\Context\CacheContextsPass;
use Drupal\Core\Cache\ListCacheBinsPass;
use Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterLazyRouteEnhancers;
diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
index bee69a1..944653a 100644
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
@@ -9,7 +9,7 @@ namespace Drupal\Core\EventSubscriber;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Cache\CacheableResponseInterface;
-use Drupal\Core\Cache\CacheContextsManager;
+use Drupal\Core\Cache\Context\CacheContextsManager;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Language\LanguageManagerInterface;
@@ -61,7 +61,7 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
/**
* The cache contexts manager service.
*
- * @var \Drupal\Core\Cache\CacheContextsManager
+ * @var \Drupal\Core\Cache\Context\CacheContextsManager
*/
protected $cacheContexts;
@@ -76,7 +76,7 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
* A policy rule determining the cacheability of a request.
* @param \Drupal\Core\PageCache\ResponsePolicyInterface $response_policy
* A policy rule determining the cacheability of a response.
- * @param \Drupal\Core\Cache\CacheContextsManager $cache_contexts_manager
+ * @param \Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager
* The cache contexts manager service.
*/
public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager) {
diff --git a/core/lib/Drupal/Core/Render/RenderCache.php b/core/lib/Drupal/Core/Render/RenderCache.php
index cba983d4..776bfd4 100644
--- a/core/lib/Drupal/Core/Render/RenderCache.php
+++ b/core/lib/Drupal/Core/Render/RenderCache.php
@@ -8,7 +8,7 @@
namespace Drupal\Core\Render;
use Drupal\Core\Cache\Cache;
-use Drupal\Core\Cache\CacheContextsManager;
+use Drupal\Core\Cache\Context\CacheContextsManager;
use Drupal\Core\Cache\CacheFactoryInterface;
use Symfony\Component\HttpFoundation\RequestStack;
@@ -34,7 +34,7 @@ class RenderCache implements RenderCacheInterface {
/**
* The cache contexts manager.
*
- * @var \Drupal\Core\Cache\CacheContextsManager
+ * @var \Drupal\Core\Cache\Context\CacheContextsManager
*/
protected $cacheContextsManager;
@@ -45,7 +45,7 @@ class RenderCache implements RenderCacheInterface {
* The request stack.
* @param \Drupal\Core\Cache\CacheFactoryInterface $cache_factory
* The cache factory.
- * @param \Drupal\Core\Cache\CacheContextsManager $cache_contexts_manager
+ * @param \Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager
* The cache contexts manager.
*/
public function __construct(RequestStack $request_stack, CacheFactoryInterface $cache_factory, CacheContextsManager $cache_contexts_manager) {
diff --git a/core/modules/block/src/Tests/BlockViewBuilderTest.php b/core/modules/block/src/Tests/BlockViewBuilderTest.php
index 02fec0f..7a7aa64 100644
--- a/core/modules/block/src/Tests/BlockViewBuilderTest.php
+++ b/core/modules/block/src/Tests/BlockViewBuilderTest.php
@@ -9,7 +9,7 @@ namespace Drupal\block\Tests;
use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache;
-use Drupal\Core\Cache\UrlCacheContext;
+use Drupal\Core\Cache\Context\UrlCacheContext;
use Drupal\simpletest\KernelTestBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
diff --git a/core/modules/book/src/Cache/BookNavigationCacheContext.php b/core/modules/book/src/Cache/BookNavigationCacheContext.php
index 531611f..15ce15a 100644
--- a/core/modules/book/src/Cache/BookNavigationCacheContext.php
+++ b/core/modules/book/src/Cache/BookNavigationCacheContext.php
@@ -7,7 +7,7 @@
namespace Drupal\book\Cache;
-use Drupal\Core\Cache\CacheContextInterface;
+use Drupal\Core\Cache\Context\CacheContextInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\HttpFoundation\RequestStack;
diff --git a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
index df75541..76d72b5 100644
--- a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
+++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
@@ -57,7 +57,7 @@ class LanguageNegotiationUrlTest extends UnitTestCase {
$this->user = $this->getMockBuilder('Drupal\Core\Session\AccountInterface')
->getMock();
- $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
+ $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$container = new ContainerBuilder();
diff --git a/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php b/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php
index e892212..13ce366 100644
--- a/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php
+++ b/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php
@@ -7,8 +7,8 @@
namespace Drupal\node\Cache;
-use Drupal\Core\Cache\CalculatedCacheContextInterface;
-use Drupal\Core\Cache\UserCacheContext;
+use Drupal\Core\Cache\Context\CalculatedCacheContextInterface;
+use Drupal\Core\Cache\Context\UserCacheContext;
/**
* Defines the node access view cache context service.
diff --git a/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php b/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php
index 53649f5..1bc28f1 100644
--- a/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php
+++ b/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php
@@ -7,7 +7,7 @@
namespace Drupal\entity_test\Cache;
-use Drupal\Core\Cache\CacheContextInterface;
+use Drupal\Core\Cache\Context\CacheContextInterface;
/**
* Defines the entity_test view grants cache context service.
diff --git a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
index d699a8e..5e7f2a2 100644
--- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
@@ -44,7 +44,7 @@ class MenuLinkTreeTest extends UnitTestCase {
$this->getMock('\Drupal\Core\Controller\ControllerResolverInterface')
);
- $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
+ $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$container = new ContainerBuilder();
diff --git a/core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php b/core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php
index abc456b..b66ba38 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php
@@ -7,7 +7,7 @@
namespace Drupal\views_test_data\Cache;
-use Drupal\Core\Cache\CacheContextInterface;
+use Drupal\Core\Cache\Context\CacheContextInterface;
/**
* Test cache context which uses a dynamic context coming from state.
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
index ccbb7d6..f2dbd3e 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
@@ -32,7 +32,7 @@ class CacheableMetadataTest extends UnitTestCase {
* @see \Drupal\Tests\Core\Cache\CacheContextsTest
*/
public function testMerge(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected) {
- $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
+ $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$container = new ContainerBuilder();
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
index 859aee6..b4f5a2d 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
@@ -5,17 +5,17 @@
* Contains \Drupal\Tests\Core\Cache\CacheContextsTest.
*/
-namespace Drupal\Tests\Core\Cache;
+namespace Drupal\Tests\Core\Cache\Context;
-use Drupal\Core\Cache\CacheContextsManager;
-use Drupal\Core\Cache\CacheContextInterface;
-use Drupal\Core\Cache\CalculatedCacheContextInterface;
+use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Cache\Context\CacheContextInterface;
+use Drupal\Core\Cache\Context\CalculatedCacheContextInterface;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\DependencyInjection\Container;
/**
- * @coversDefaultClass \Drupal\Core\Cache\CacheContextsManager
+ * @coversDefaultClass \Drupal\Core\Cache\Context\CacheContextsManager
* @group Cache
*/
class CacheContextsManagerTest extends UnitTestCase {
diff --git a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
index 51ff506..644df8a 100644
--- a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
@@ -53,7 +53,7 @@ class BubbleableMetadataTest extends UnitTestCase {
->getMock();
}
- $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
+ $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$container = new ContainerBuilder();
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
index 1ccdd2a..7388c61 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
@@ -48,7 +48,7 @@ class RendererTestBase extends UnitTestCase {
protected $cacheFactory;
/**
- * @var \Drupal\Core\Cache\CacheContextsManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Drupal\Core\Cache\Context\CacheContextsManager|\PHPUnit_Framework_MockObject_MockObject
*/
protected $cacheContexts;
@@ -101,7 +101,7 @@ class RendererTestBase extends UnitTestCase {
$this->elementInfo = $this->getMock('Drupal\Core\Render\ElementInfoManagerInterface');
$this->requestStack = new RequestStack();
$this->cacheFactory = $this->getMock('Drupal\Core\Cache\CacheFactoryInterface');
- $this->cacheContextsManager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
+ $this->cacheContextsManager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$this->cacheContextsManager->expects($this->any())
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
index 677d214..f4e90de 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
@@ -59,7 +59,7 @@ class UrlGeneratorTest extends UnitTestCase {
* {@inheritdoc}
*/
protected function setUp() {
- $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
+ $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$container = new ContainerBuilder();