Commit 85996b00 authored by jhodgdon's avatar jhodgdon

Issue #1831702 by miro_dietiker: Correct docs for CacheArray methods and overrides

parent 6c4911e0
...@@ -22,7 +22,7 @@ class ModuleInfo extends CacheArray { ...@@ -22,7 +22,7 @@ class ModuleInfo extends CacheArray {
protected $info; protected $info;
/** /**
* Overrides CacheArray::resolveCacheMiss(). * Implements CacheArray::resolveCacheMiss().
*/ */
function resolveCacheMiss($offset) { function resolveCacheMiss($offset) {
$data = array(); $data = array();
......
...@@ -23,7 +23,7 @@ public function __construct() { ...@@ -23,7 +23,7 @@ public function __construct() {
} }
/** /**
* Overrides CacheArray::resolveCacheMiss(). * Implements CacheArray::resolveCacheMiss().
*/ */
protected function resolveCacheMiss($offset) { protected function resolveCacheMiss($offset) {
$complete_schema = drupal_get_complete_schema(); $complete_schema = drupal_get_complete_schema();
......
...@@ -79,6 +79,9 @@ function initializeRegistry() { ...@@ -79,6 +79,9 @@ function initializeRegistry() {
return array_fill_keys(array_keys($this->completeRegistry), NULL); return array_fill_keys(array_keys($this->completeRegistry), NULL);
} }
/**
* Overrides CacheArray::offsetExists().
*/
public function offsetExists($offset) { public function offsetExists($offset) {
// Since the theme registry allows for theme hooks to be requested that // Since the theme registry allows for theme hooks to be requested that
// are not registered, just check the existence of the key in the registry. // are not registered, just check the existence of the key in the registry.
...@@ -87,6 +90,9 @@ public function offsetExists($offset) { ...@@ -87,6 +90,9 @@ public function offsetExists($offset) {
return array_key_exists($offset, $this->storage); return array_key_exists($offset, $this->storage);
} }
/**
* Overrides CacheArray::offsetGet().
*/
public function offsetGet($offset) { public function offsetGet($offset) {
// If the offset is set but empty, it is a registered theme hook that has // If the offset is set but empty, it is a registered theme hook that has
// not yet been requested. Offsets that do not exist at all were not // not yet been requested. Offsets that do not exist at all were not
...@@ -99,6 +105,9 @@ public function offsetGet($offset) { ...@@ -99,6 +105,9 @@ public function offsetGet($offset) {
} }
} }
/**
* Implements CacheArray::resolveCacheMiss().
*/
public function resolveCacheMiss($offset) { public function resolveCacheMiss($offset) {
if (!isset($this->completeRegistry)) { if (!isset($this->completeRegistry)) {
$this->completeRegistry = theme_get_registry(); $this->completeRegistry = theme_get_registry();
...@@ -110,6 +119,9 @@ public function resolveCacheMiss($offset) { ...@@ -110,6 +119,9 @@ public function resolveCacheMiss($offset) {
return $this->storage[$offset]; return $this->storage[$offset];
} }
/**
* Overrides CacheArray::set().
*/
public function set($data, $lock = TRUE) { public function set($data, $lock = TRUE) {
$lock_name = $this->cid . ':' . $this->bin; $lock_name = $this->cid . ':' . $this->bin;
if (!$lock || lock()->acquire($lock_name)) { if (!$lock || lock()->acquire($lock_name)) {
......
...@@ -51,7 +51,7 @@ public function __construct($langcode, $context, $stringStorage) { ...@@ -51,7 +51,7 @@ public function __construct($langcode, $context, $stringStorage) {
} }
/** /**
* Overrides CacheArray::resolveCacheMiss(). * Implements CacheArray::resolveCacheMiss().
*/ */
protected function resolveCacheMiss($offset) { protected function resolveCacheMiss($offset) {
$translation = $this->stringStorage->findTranslation(array( $translation = $this->stringStorage->findTranslation(array(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment