1 | <?php |
||
12 | class DeltaMiddleware implements Middleware |
||
13 | { |
||
14 | use MiddlewareCommon; |
||
15 | |||
16 | /** |
||
17 | * Source for deltas |
||
18 | * |
||
19 | * @var DeltaConfigCollection |
||
20 | */ |
||
21 | protected $collection = null; |
||
22 | |||
23 | /** |
||
24 | * DeltaMiddleware constructor. |
||
25 | * |
||
26 | * @param DeltaConfigCollection $collection |
||
27 | * @param int $disableFlag |
||
28 | */ |
||
29 | 4 | public function __construct(DeltaConfigCollection $collection, $disableFlag = 0) |
|
34 | |||
35 | /** |
||
36 | * @return DeltaConfigCollection |
||
37 | */ |
||
38 | 4 | public function getCollection() |
|
42 | |||
43 | /** |
||
44 | * @param DeltaConfigCollection $collection |
||
45 | * @return $this |
||
46 | */ |
||
47 | 4 | public function setCollection(DeltaConfigCollection $collection) |
|
52 | |||
53 | /** |
||
54 | * Get config for a class |
||
55 | * |
||
56 | * @param string $class Name of class |
||
57 | * @param int|true $excludeMiddleware Middleware disable flags |
||
58 | * @param callable $next Callback to next middleware |
||
59 | * @return array Complete class config |
||
60 | */ |
||
61 | 4 | public function getClassConfig($class, $excludeMiddleware, $next) |
|
83 | |||
84 | /** |
||
85 | * Apply a single delta to a class config |
||
86 | * |
||
87 | * @param array $config |
||
88 | * @param array $delta |
||
89 | * @return array |
||
90 | */ |
||
91 | 3 | protected function applyDelta($config, $delta) |
|
108 | } |
||
109 |