Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
3 / 3 |
KeyValueMemoryFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
get | |
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\Core\KeyValueStore\KeyValueMemoryFactory. | |
*/ | |
namespace Drupal\Core\KeyValueStore; | |
/** | |
* Defines the key/value store factory for the memory backend. | |
*/ | |
class KeyValueMemoryFactory implements KeyValueFactoryInterface { | |
/** | |
* An array of keyvalue collections that are stored in memory. | |
* | |
* @var array | |
*/ | |
protected $collections = array(); | |
/** | |
* {@inheritdoc} | |
*/ | |
public function get($collection) { | |
if (!isset($this->collections[$collection])) { | |
$this->collections[$collection] = new MemoryStorage($collection); | |
} | |
return $this->collections[$collection]; | |
} | |
} |