diff --git a/core/lib/Drupal/Core/Cache/CacheCollector.php b/core/lib/Drupal/Core/Cache/CacheCollector.php index f7d88c3..78373ec 100644 --- a/core/lib/Drupal/Core/Cache/CacheCollector.php +++ b/core/lib/Drupal/Core/Cache/CacheCollector.php @@ -117,14 +117,14 @@ public function __construct($cid, CacheBackendInterface $cache, LockBackendInter } /** - * Implements CacheCollectorInterface::has(). + * {@inheritdoc} */ public function has($key) { return $this->get($key) !== NULL; } /** - * Implements CacheCollectorInterface::get(). + * {@inheritdoc} */ public function get($key) { if (isset($this->storage[$key]) || array_key_exists($key, $this->storage)) { @@ -155,7 +155,7 @@ public function set($key, $value) { } /** - * Implements CacheCollectorInterface::delete(). + * {@inheritdoc} */ public function delete($key) { unset($this->storage[$key]); @@ -174,7 +174,7 @@ public function delete($key) { * @param string $key * The key that was request. * @param bool $persist - * (ptional) Whether the offset should be persisted or not, defaults to + * (optional) Whether the offset should be persisted or not, defaults to * TRUE. When called with $persist = FALSE the offset will be unflagged so * that it will not written at the end of the request. */ @@ -192,7 +192,7 @@ protected function persist($key, $persist = TRUE) { * @param sring $key * The offset that was requested. * - * @return + * @return mixed * The value of the offset, or NULL if no value was found. */ abstract protected function resolveCacheMiss($key); @@ -250,14 +250,7 @@ protected function updateCache($lock = TRUE) { } /** - * Implements KernelServiceDestruction::destruct(). - */ - public function destruct() { - $this->updateCache(); - } - - /** - * Implements CacheCollectorInterface::reset(). + * {@inheritdoc} */ public function reset() { $this->storage = array(); @@ -265,4 +258,11 @@ public function reset() { $this->keysToRemove = array(); } + /** + * {@inheritdoc} + */ + public function destruct() { + $this->updateCache(); + } + } diff --git a/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php b/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php index cf5fe51..6862543 100644 --- a/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php +++ b/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\Core\Cache\CacheCollectorInterface. + * Contains \Drupal\Core\Cache\CacheCollectorInterface. */ namespace Drupal\Core\Cache; diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php index a99008d..46151b6 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php @@ -42,7 +42,7 @@ public function __construct(CacheBackendInterface $cache, LockBackendInterface $ } /** - * Implements \Drupal\Core\Cache\CacheCollector::resolveCacheMiss(). + * {@inheritdoc} */ protected function resolveCacheMiss($offset) { $this->storage[$offset] = $this->keyValueStore->get($offset); @@ -51,7 +51,7 @@ protected function resolveCacheMiss($offset) { } /** - * Overrides \Drupal\Core\Cache\CacheCollector::delete(). + * {@inheritdoc} */ public function delete($key) { parent::delete($key); @@ -59,7 +59,7 @@ public function delete($key) { } /** - * Implements KeyValueStoreInterface::deleteMultiple(). + * {@inheritdoc} */ public function deleteMultiple(array $keys) { foreach ($keys as $key) { @@ -69,22 +69,24 @@ public function deleteMultiple(array $keys) { } /** - * Implements KeyValueStoreInterface::getAll(). + * {@inheritdoc} */ public function getAll() { - // Don't cache this. + // Caching this would mean that the whole store is added to the cache, + // this is expected to be a non-frequent operation that is not worth to be + // loaded from cache. return $this->keyValueStore->getAll(); } /** - * Implements KeyValueStoreInterface::getCollectionName(). + * {@inheritdoc} */ public function getCollectionName() { return $this->keyValueStore->getCollectionName(); } /** - * Implements KeyValueStoreInterface::getMultiple(). + * {@inheritdoc} */ public function getMultiple(array $keys) { $values = array(); @@ -99,7 +101,7 @@ public function getMultiple(array $keys) { } /** - * Implements KeyValueStoreInterface::setIfNotExists(). + * {@inheritdoc} */ public function setIfNotExists($key, $value) { if ($this->keyValueStore->setIfNotExists($key, $value)) { @@ -110,7 +112,7 @@ public function setIfNotExists($key, $value) { } /** - * Implements KeyValueStoreInterface::setMultiple(). + * {@inheritdoc} */ public function setMultiple(array $data) { $this->keyValueStore->setMultiple($data); @@ -121,7 +123,7 @@ public function setMultiple(array $data) { } /** - * Implements KeyValueStoreInterface::set(). + * {@inheritdoc} */ public function set($key, $value) { $this->keyValueStore->set($key, $value); @@ -130,7 +132,7 @@ public function set($key, $value) { } /** - * Implements KeyValueStoreInterface::set(). + * {@inheritdoc} */ public function deleteAll() { $this->keyValueStore->deleteAll(); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 0b99253..8ace9c3 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -927,7 +927,7 @@ protected function refreshVariables() { cache('bootstrap')->delete('variables'); $conf = variable_initialize(); \Drupal::service('config.factory')->reset(); - \Drupal::service('state')->reset(); + \Drupal::state()->reset(); } /**