Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
47 | public function __construct(Config $source, Closure $observer, array $keys) |
||
48 | { |
||
49 | $this->source = $source; |
||
50 | |||
51 | $this->observer = function ($value, string $key) use ($observer) { |
||
52 | $priority = $this->ordered[$key]; |
||
53 | if ($priority >= $this->priority) { |
||
54 | $this->priority = $priority; |
||
55 | $observer($value, $key); |
||
56 | } |
||
57 | }; |
||
58 | |||
59 | foreach ($keys as $priority => $key) { |
||
60 | $this->ordered[$key] = $priority; |
||
61 | $this->watches[$priority] = $this->source->watching($key, $this->observer); |
||
62 | } |
||
76 |