Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / KeyValueStore / KeyValueMemoryFactory.php
1 <?php
2
3 namespace Drupal\Core\KeyValueStore;
4
5 /**
6  * Defines the key/value store factory for the memory backend.
7  */
8 class KeyValueMemoryFactory implements KeyValueFactoryInterface {
9
10   /**
11    * An array of keyvalue collections that are stored in memory.
12    *
13    * @var array
14    */
15   protected $collections = [];
16
17   /**
18    * {@inheritdoc}
19    */
20   public function get($collection) {
21     if (!isset($this->collections[$collection])) {
22       $this->collections[$collection] = new MemoryStorage($collection);
23     }
24     return $this->collections[$collection];
25   }
26
27 }