diff --git a/core/core.services.yml b/core/core.services.yml index 0c8c697..c243eab 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\Contexts\IpCacheContext + class: Drupal\Core\Cache\Context\IpCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.headers: - class: Drupal\Core\Cache\Contexts\HeadersCacheContext + class: Drupal\Core\Cache\Context\HeadersCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.cookies: - class: Drupal\Core\Cache\Contexts\CookiesCacheContext + class: Drupal\Core\Cache\Context\CookiesCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.request_format: - class: Drupal\Core\Cache\Contexts\RequestFormatCacheContext + class: Drupal\Core\Cache\Context\RequestFormatCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.url: - class: Drupal\Core\Cache\Contexts\UrlCacheContext + class: Drupal\Core\Cache\Context\UrlCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.url.site: - class: Drupal\Core\Cache\Contexts\SiteCacheContext + class: Drupal\Core\Cache\Context\SiteCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.url.query_args: - class: Drupal\Core\Cache\Contexts\QueryArgsCacheContext + class: Drupal\Core\Cache\Context\QueryArgsCacheContext arguments: ['@request_stack'] tags: - { name: cache.context } cache_context.url.query_args.pagers: - class: Drupal\Core\Cache\Contexts\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\Contexts\RouteCacheContext + class: Drupal\Core\Cache\Context\RouteCacheContext arguments: ['@current_route_match'] tags: - { name: cache.context } cache_context.route.name: - class: Drupal\Core\Cache\Contexts\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\Contexts\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\Contexts\UserCacheContext + class: Drupal\Core\Cache\Context\UserCacheContext arguments: ['@current_user'] tags: - { name: cache.context} cache_context.user.permissions: - class: Drupal\Core\Cache\Contexts\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\Contexts\UserRolesCacheContext + class: Drupal\Core\Cache\Context\UserRolesCacheContext arguments: ['@current_user'] tags: - { name: cache.context} cache_context.user.is_super_user: - class: Drupal\Core\Cache\Contexts\IsSuperUserCacheContext + class: Drupal\Core\Cache\Context\IsSuperUserCacheContext arguments: ['@current_user'] tags: - { name: cache.context} cache_context.languages: - class: Drupal\Core\Cache\Contexts\LanguagesCacheContext + class: Drupal\Core\Cache\Context\LanguagesCacheContext arguments: ['@language_manager'] tags: - { name: cache.context} cache_context.theme: - class: Drupal\Core\Cache\Contexts\ThemeCacheContext + class: Drupal\Core\Cache\Context\ThemeCacheContext arguments: ['@theme.manager'] tags: - { name: cache.context} cache_context.timezone: - class: Drupal\Core\Cache\Contexts\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\Contexts\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 c2dc8e1..9c4e42f 100644 --- a/core/lib/Drupal/Core/Access/AccessResult.php +++ b/core/lib/Drupal/Core/Access/AccessResult.php @@ -31,8 +31,8 @@ /** * The cache context IDs (to vary a cache item ID based on active contexts). * - * @see \Drupal\Core\Cache\Contexts\CacheContextInterface - * @see \Drupal\Core\Cache\Contexts\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 efe7431..ee1241b 100644 --- a/core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php +++ b/core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php @@ -31,7 +31,7 @@ * @return string[] * An array of cache context tokens, used to generate a cache ID. * - * @see \Drupal\Core\Cache\Contexts\CacheContextsManager::convertTokensToKeys() + * @see \Drupal\Core\Cache\Context\CacheContextsManager::convertTokensToKeys() */ public function getCacheContexts(); diff --git a/core/lib/Drupal/Core/Cache/Contexts/AccountPermissionsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php similarity index 92% rename from core/lib/Drupal/Core/Cache/Contexts/AccountPermissionsCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php index 9ebc858..7afce73 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/AccountPermissionsCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\UserRolesCacheContext. + * Contains \Drupal\Core\Cache\Context\UserRolesCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\PermissionsHashGeneratorInterface; diff --git a/core/lib/Drupal/Core/Cache/Contexts/CacheContextInterface.php b/core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php similarity index 86% rename from core/lib/Drupal/Core/Cache/Contexts/CacheContextInterface.php rename to core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php index ce36a5e..ada3174 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/CacheContextInterface.php +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\CacheContextInterface. + * Contains \Drupal\Core\Cache\Context\CacheContextInterface. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Provides an interface for defining a cache context service. diff --git a/core/lib/Drupal/Core/Cache/Contexts/CacheContextsManager.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php similarity index 95% rename from core/lib/Drupal/Core/Cache/Contexts/CacheContextsManager.php rename to core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php index af68c3b..27b012a 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/CacheContextsManager.php +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\CacheContextsManager. + * Contains \Drupal\Core\Cache\Context\CacheContextsManager. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Drupal\Component\Utility\SafeMarkup; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,9 +21,9 @@ * 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\Contexts\CacheContextInterface - * @see \Drupal\Core\Cache\Contexts\CalculatedCacheContextInterface - * @see \Drupal\Core\Cache\Contexts\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 @@ public function optimizeTokens(array $context_tokens) { * The context ID, which together with the service ID prefix allows the * corresponding cache context service to be retrieved. * - * @return \Drupal\Core\Cache\Contexts\CacheContextInterface + * @return \Drupal\Core\Cache\Context\CacheContextInterface * The requested cache context service. */ protected function getService($context_id) { @@ -231,7 +231,7 @@ public static function parseTokens(array $context_tokens) { * * @throws \LogicException * - * @see \Drupal\Core\Cache\Contexts\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/Contexts/CacheContextsPass.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php similarity index 94% rename from core/lib/Drupal/Core/Cache/Contexts/CacheContextsPass.php rename to core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php index 9e1bc48..ce8e2f4 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/CacheContextsPass.php +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\CacheContextsPass. + * Contains \Drupal\Core\Cache\Context\CacheContextsPass. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/core/lib/Drupal/Core/Cache/Contexts/CalculatedCacheContextInterface.php b/core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php similarity index 89% rename from core/lib/Drupal/Core/Cache/Contexts/CalculatedCacheContextInterface.php rename to core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php index a3b82f1..4242109 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/CalculatedCacheContextInterface.php +++ b/core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\CacheContextInterface. + * Contains \Drupal\Core\Cache\Context\CacheContextInterface. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Provides an interface for defining a calculated cache context service. diff --git a/core/lib/Drupal/Core/Cache/Contexts/CookiesCacheContext.php b/core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php similarity index 85% rename from core/lib/Drupal/Core/Cache/Contexts/CookiesCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php index f64c923..e7850b8 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/CookiesCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\CookiesCacheContext. + * Contains \Drupal\Core\Cache\Context\CookiesCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the CookiesCacheContext service, for "per cookie" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/HeadersCacheContext.php b/core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php similarity index 85% rename from core/lib/Drupal/Core/Cache/Contexts/HeadersCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php index e19aab6..1644aa0 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/HeadersCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\HeadersCacheContext. + * Contains \Drupal\Core\Cache\Context\HeadersCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the HeadersCacheContext service, for "per header" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/IpCacheContext.php b/core/lib/Drupal/Core/Cache/Context/IpCacheContext.php similarity index 81% rename from core/lib/Drupal/Core/Cache/Contexts/IpCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/IpCacheContext.php index 6b31802..4841482 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/IpCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/IpCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\IpCacheContext. + * Contains \Drupal\Core\Cache\Context\IpCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the IpCacheContext service, for "per IP address" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/IsSuperUserCacheContext.php b/core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php similarity index 79% rename from core/lib/Drupal/Core/Cache/Contexts/IsSuperUserCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php index 3c2a3f4..3f27059 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/IsSuperUserCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\IsSuperUserCacheContext. + * Contains \Drupal\Core\Cache\Context\IsSuperUserCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the IsSuperUserCacheContext service, for "super user or not" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/LanguagesCacheContext.php b/core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php similarity index 95% rename from core/lib/Drupal/Core/Cache/Contexts/LanguagesCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php index 050371d..2bf9a2f 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/LanguagesCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\LanguagesCacheContext. + * Contains \Drupal\Core\Cache\Context\LanguagesCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Drupal\Core\Language\LanguageManagerInterface; diff --git a/core/lib/Drupal/Core/Cache/Contexts/MenuActiveTrailsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php similarity index 87% rename from core/lib/Drupal/Core/Cache/Contexts/MenuActiveTrailsCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php index 1549ebd..40cc077 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/MenuActiveTrailsCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\MenuActiveTrailsCacheContext. + * Contains \Drupal\Core\Cache\Context\MenuActiveTrailsCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Symfony\Component\DependencyInjection\ContainerAware; diff --git a/core/lib/Drupal/Core/Cache/Contexts/PagersCacheContext.php b/core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php similarity index 88% rename from core/lib/Drupal/Core/Cache/Contexts/PagersCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php index dee5cf3..23bdb7c 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/PagersCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\PagersCacheContext. + * Contains \Drupal\Core\Cache\Context\PagersCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines a cache context for "per page in a pager" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/QueryArgsCacheContext.php b/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php similarity index 88% rename from core/lib/Drupal/Core/Cache/Contexts/QueryArgsCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php index 10952be..e9a7664 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/QueryArgsCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\QueryArgsCacheContext. + * Contains \Drupal\Core\Cache\Context\QueryArgsCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the QueryArgsCacheContext service, for "per query args" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/RequestFormatCacheContext.php b/core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php similarity index 80% rename from core/lib/Drupal/Core/Cache/Contexts/RequestFormatCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php index 35ce30b..c3e544d 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/RequestFormatCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\RequestFormatCacheContext. + * Contains \Drupal\Core\Cache\Context\RequestFormatCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the RequestFormatCacheContext service, for "per format" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/RequestStackCacheContextBase.php b/core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php similarity index 85% rename from core/lib/Drupal/Core/Cache/Contexts/RequestStackCacheContextBase.php rename to core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php index d48d84a..2a8f22d 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/RequestStackCacheContextBase.php +++ b/core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\RequestStackCacheContextBase. + * Contains \Drupal\Core\Cache\Context\RequestStackCacheContextBase. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Symfony\Component\HttpFoundation\RequestStack; diff --git a/core/lib/Drupal/Core/Cache/Contexts/RouteCacheContext.php b/core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php similarity index 90% rename from core/lib/Drupal/Core/Cache/Contexts/RouteCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php index aac751e..0643d8b 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/RouteCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\RouteCacheContext. + * Contains \Drupal\Core\Cache\Context\RouteCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Drupal\Core\Routing\RouteMatchInterface; diff --git a/core/lib/Drupal/Core/Cache/Contexts/RouteNameCacheContext.php b/core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php similarity index 79% rename from core/lib/Drupal/Core/Cache/Contexts/RouteNameCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php index e288620..dcca18b 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/RouteNameCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\RouteNameCacheContext. + * Contains \Drupal\Core\Cache\Context\RouteNameCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the RouteCacheContext service, for "per route name" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/SiteCacheContext.php b/core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php similarity index 90% rename from core/lib/Drupal/Core/Cache/Contexts/SiteCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php index 73f9f15..4e0c123 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/SiteCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\SiteCacheContext. + * Contains \Drupal\Core\Cache\Context\SiteCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the SiteCacheContext service, for "per site" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/ThemeCacheContext.php b/core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php similarity index 89% rename from core/lib/Drupal/Core/Cache/Contexts/ThemeCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php index f24ef19..5f478ec 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/ThemeCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\LanguageCacheContext. + * Contains \Drupal\Core\Cache\Context\LanguageCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Theme\ThemeManagerInterface; diff --git a/core/lib/Drupal/Core/Cache/Contexts/TimeZoneCacheContext.php b/core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php similarity index 84% rename from core/lib/Drupal/Core/Cache/Contexts/TimeZoneCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php index cbbc7cc..7e5b7c5 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/TimeZoneCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\TimeZoneCacheContext. + * Contains \Drupal\Core\Cache\Context\TimeZoneCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the TimeZoneCacheContext service, for "per time zone" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/UrlCacheContext.php b/core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php similarity index 80% rename from core/lib/Drupal/Core/Cache/Contexts/UrlCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php index fedcc34..1ea0bf0 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/UrlCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\UrlCacheContext. + * Contains \Drupal\Core\Cache\Context\UrlCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; /** * Defines the UrlCacheContext service, for "per page" caching. diff --git a/core/lib/Drupal/Core/Cache/Contexts/UserCacheContext.php b/core/lib/Drupal/Core/Cache/Context/UserCacheContext.php similarity index 86% rename from core/lib/Drupal/Core/Cache/Contexts/UserCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/UserCacheContext.php index 849e417..80ad519 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/UserCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/UserCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\UserCacheContext. + * Contains \Drupal\Core\Cache\Context\UserCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +namespace Drupal\Core\Cache\Context; use Drupal\Core\Session\AccountInterface; diff --git a/core/lib/Drupal/Core/Cache/Contexts/UserRolesCacheContext.php b/core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php similarity index 85% rename from core/lib/Drupal/Core/Cache/Contexts/UserRolesCacheContext.php rename to core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php index 6b78626..375d80b 100644 --- a/core/lib/Drupal/Core/Cache/Contexts/UserRolesCacheContext.php +++ b/core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Cache\Contexts\UserRolesCacheContext. + * Contains \Drupal\Core\Cache\Context\UserRolesCacheContext. */ -namespace Drupal\Core\Cache\Contexts; +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 656851c..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\Contexts\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 09132e5..944653a 100644 --- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php @@ -9,7 +9,7 @@ use Drupal\Component\Datetime\DateTimePlus; use Drupal\Core\Cache\CacheableResponseInterface; -use Drupal\Core\Cache\Contexts\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\Contexts\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\Contexts\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/MainContent/HtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php index df9587e..1fa0604 100644 --- a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php @@ -11,7 +11,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\CacheableResponse; -use Drupal\Core\Cache\Contexts\CacheContextsManager; +use Drupal\Core\Cache\Context\CacheContextsManager; use Drupal\Core\Controller\TitleResolverInterface; use Drupal\Core\Display\PageVariantInterface; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -82,7 +82,7 @@ class HtmlRenderer implements MainContentRendererInterface { /** * The cache contexts manager service. * - * @var \Drupal\Core\Cache\Contexts\CacheContextsManager + * @var \Drupal\Core\Cache\Context\CacheContextsManager */ protected $cacheContexts; @@ -103,7 +103,7 @@ class HtmlRenderer implements MainContentRendererInterface { * The renderer service. * @param \Drupal\Core\Render\RenderCacheInterface $render_cache * The render cache service. - * @param \Drupal\Core\Cache\Contexts\CacheContextsManager $cache_contexts_manager + * @param \Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager * The cache contexts manager service. */ public function __construct(TitleResolverInterface $title_resolver, PluginManagerInterface $display_variant_manager, EventDispatcherInterface $event_dispatcher, ElementInfoManagerInterface $element_info_manager, ModuleHandlerInterface $module_handler, RendererInterface $renderer, RenderCacheInterface $render_cache, CacheContextsManager $cache_contexts_manager) { diff --git a/core/lib/Drupal/Core/Render/RenderCache.php b/core/lib/Drupal/Core/Render/RenderCache.php index ce526da..b53a944 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\Contexts\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\Contexts\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\Contexts\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 a58c9f4..7a7aa64 100644 --- a/core/modules/block/src/Tests/BlockViewBuilderTest.php +++ b/core/modules/block/src/Tests/BlockViewBuilderTest.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Cache\Cache; -use Drupal\Core\Cache\Contexts\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 23719c2..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\Contexts\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 89a44f7..76d72b5 100644 --- a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php +++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php @@ -57,7 +57,7 @@ protected function setUp() { $this->user = $this->getMockBuilder('Drupal\Core\Session\AccountInterface') ->getMock(); - $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Contexts\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 7c82963..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\Contexts\CalculatedCacheContextInterface; -use Drupal\Core\Cache\Contexts\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 eee4dd3..f16521f 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\Contexts\CacheContextInterface; +use Drupal\Core\Cache\Context\CacheContextInterface; /** * Defines the entity_test view grants cache context service. 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 94db225..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\Contexts\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 cd24e86..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\Contexts\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 similarity index 96% rename from core/tests/Drupal/Tests/Core/Cache/CacheContextsManagerTest.php rename to core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php index 20f9f94..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\Contexts\CacheContextsManager; -use Drupal\Core\Cache\Contexts\CacheContextInterface; -use Drupal\Core\Cache\Contexts\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\Contexts\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 09f589b..ae9ce94 100644 --- a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php +++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php @@ -53,7 +53,7 @@ public function testMerge(BubbleableMetadata $a, CacheableMetadata $b, Bubbleabl ->getMock(); } - $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Contexts\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 d9cc953..19ae988 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\Contexts\CacheContextsManager|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Cache\Context\CacheContextsManager|\PHPUnit_Framework_MockObject_MockObject */ protected $cacheContexts; @@ -101,7 +101,7 @@ protected function setUp() { $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\Contexts\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 dd22269..37add3d 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\Contexts\CacheContextsManager') + $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager') ->disableOriginalConstructor() ->getMock(); $container = new ContainerBuilder();