core/lib/Drupal/Core/Cache/CacheContexts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/Drupal/Core/Cache/CacheContexts.php b/core/lib/Drupal/Core/Cache/CacheContexts.php index 665ee79..5f8202f 100644 --- a/core/lib/Drupal/Core/Cache/CacheContexts.php +++ b/core/lib/Drupal/Core/Cache/CacheContexts.php @@ -224,7 +224,7 @@ public static function parseTokens(array $context_tokens) { /** * Validates an array of cache context tokens. * - * Can be called before using cache tags in operations, to ensure validity. + * Can be called before using cache contexts in operations, to check validity. * * @param string[] $context_tokens * An array of cache context tokens. @@ -245,7 +245,7 @@ public function validateTokens(array $context_tokens = []) { foreach ($context_tokens as $context_token) { if (!is_string($context_token)) { - throw new \LogicException('Cache contexts must be strings, ' . gettype($context_token) . ' given.'); + throw new \LogicException(sprintf('Cache contexts must be strings, %s given.', gettype($context_token))); } if (isset($this->validContextTokens[$context_token])) { @@ -266,7 +266,7 @@ public function validateTokens(array $context_tokens = []) { $this->validContextTokens[$context_token] = TRUE; } else { - throw new \LogicException('"' . $context_id . '" is not a valid cache context ID.'); + throw new \LogicException(sprintf('"%s" is not a valid cache context ID.', $context_id)); } } }