1 | <?php |
||
9 | class CachedConfigCollection implements ConfigCollectionInterface |
||
10 | { |
||
11 | use MiddlewareAware; |
||
12 | |||
13 | /** |
||
14 | * @const string |
||
15 | */ |
||
16 | const CACHE_KEY = '__CACHE__'; |
||
17 | |||
18 | /** |
||
19 | * @var CacheInterface |
||
20 | */ |
||
21 | protected $cache; |
||
22 | |||
23 | /** |
||
24 | * Nested config to delegate to |
||
25 | * |
||
26 | * @var ConfigCollectionInterface |
||
27 | */ |
||
28 | protected $collection; |
||
29 | |||
30 | /** |
||
31 | * @var callable |
||
32 | */ |
||
33 | protected $collectionCreator; |
||
34 | |||
35 | /** |
||
36 | * @var bool |
||
37 | */ |
||
38 | protected $flush = false; |
||
39 | |||
40 | /** |
||
41 | * Set to true while building config. |
||
42 | * Used to protect against infinite loops. |
||
43 | * |
||
44 | * @var bool |
||
45 | */ |
||
46 | protected $building = false; |
||
47 | |||
48 | /** |
||
49 | * Injectable factory for nesting config. |
||
50 | * This callback will be passed the inner ConfigCollection |
||
51 | * |
||
52 | * @var callable |
||
53 | */ |
||
54 | protected $nestFactory = null; |
||
55 | |||
56 | /** |
||
57 | * @return static |
||
58 | */ |
||
59 | public static function create() |
||
63 | |||
64 | /** |
||
65 | * Get callback for nesting the inner collection |
||
66 | * |
||
67 | * @return callable |
||
68 | */ |
||
69 | public function getNestFactory() |
||
73 | |||
74 | /** |
||
75 | * Set callback for nesting the inner collection |
||
76 | * |
||
77 | * @param callable $factory |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function setNestFactory(callable $factory) |
||
85 | |||
86 | 2 | public function get($class, $name = null, $excludeMiddleware = 0) |
|
90 | |||
91 | public function getAll() |
||
95 | |||
96 | 2 | public function exists($class, $name = null, $excludeMiddleware = 0) |
|
100 | |||
101 | public function getMetadata() |
||
105 | |||
106 | public function getHistory() |
||
110 | |||
111 | /** |
||
112 | * Get or build collection |
||
113 | * |
||
114 | * @return ConfigCollectionInterface |
||
115 | */ |
||
116 | 3 | public function getCollection() |
|
149 | |||
150 | /** |
||
151 | * Commits the cache |
||
152 | */ |
||
153 | 2 | public function __destruct() |
|
163 | |||
164 | public function nest() |
||
175 | |||
176 | /** |
||
177 | * Set a PSR-16 cache |
||
178 | * |
||
179 | * @param CacheInterface $cache |
||
180 | * @return $this |
||
181 | */ |
||
182 | 3 | public function setCache(CacheInterface $cache) |
|
190 | |||
191 | /** |
||
192 | * @param callable $collectionCreator |
||
193 | * @return $this |
||
194 | */ |
||
195 | 3 | public function setCollectionCreator($collectionCreator) |
|
200 | |||
201 | /** |
||
202 | * @return callable |
||
203 | */ |
||
204 | public function getCollectionCreator() |
||
208 | |||
209 | /** |
||
210 | * @return CacheInterface |
||
211 | */ |
||
212 | public function getCache() |
||
216 | |||
217 | /** |
||
218 | * @param bool $flush |
||
219 | * @return $this |
||
220 | */ |
||
221 | public function setFlush($flush) |
||
229 | |||
230 | /** |
||
231 | * @return bool |
||
232 | */ |
||
233 | public function getFlush() |
||
237 | |||
238 | public function setMiddlewares($middlewares) |
||
244 | |||
245 | /** |
||
246 | * @deprecated 4.0...5.0 Please use YAML configuration, ::modify()->set() or ::modify()->merge() |
||
247 | * @throws BadMethodCallException |
||
248 | */ |
||
249 | public function update($class, $name, $value) |
||
255 | } |
||
256 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.