Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Config / NullStorage.php
1 <?php
2
3 namespace Drupal\Core\Config;
4
5 /**
6  * Defines a stub storage.
7  *
8  * This storage is always empty; the controller reads and writes nothing.
9  *
10  * The stub implementation is needed for synchronizing configuration during
11  * installation of a module, in which case all configuration being shipped with
12  * the module is known to be new. Therefore, the module installation process is
13  * able to short-circuit the full diff against the active configuration; the
14  * diff would yield all currently available configuration as items to remove,
15  * since they do not exist in the module's default configuration directory.
16  *
17  * This also can be used for testing purposes.
18  */
19 class NullStorage implements StorageInterface {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function exists($name) {
25     return FALSE;
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function read($name) {
32     return [];
33   }
34
35   /**
36    * {@inheritdoc}
37    */
38   public function readMultiple(array $names) {
39     return [];
40   }
41
42   /**
43    * {@inheritdoc}
44    */
45   public function write($name, array $data) {
46     return FALSE;
47   }
48
49   /**
50    * {@inheritdoc}
51    */
52   public function delete($name) {
53     return FALSE;
54   }
55
56   /**
57    * {@inheritdoc}
58    */
59   public function rename($name, $new_name) {
60     return FALSE;
61   }
62
63   /**
64    * {@inheritdoc}
65    */
66   public function encode($data) {
67     return $data;
68   }
69
70   /**
71    * {@inheritdoc}
72    */
73   public function decode($raw) {
74     return $raw;
75   }
76
77   /**
78    * {@inheritdoc}
79    */
80   public function listAll($prefix = '') {
81     return [];
82   }
83
84   /**
85    * {@inheritdoc}
86    */
87   public function deleteAll($prefix = '') {
88     return FALSE;
89   }
90
91   /**
92    * {@inheritdoc}
93    */
94   public function createCollection($collection) {
95     // No op.
96   }
97
98   /**
99    * {@inheritdoc}
100    */
101   public function getAllCollectionNames() {
102     return [];
103   }
104
105   /**
106    * {@inheritdoc}
107    */
108   public function getCollectionName() {
109     return '';
110   }
111
112 }