Total Complexity | 7 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class FromFileSchemaProvider implements SchemaProviderInterface |
||
16 | { |
||
17 | private string $file = ''; |
||
18 | private Aliases $aliases; |
||
19 | |||
20 | public function __construct(Aliases $aliases) |
||
21 | { |
||
22 | $this->aliases = $aliases; |
||
23 | } |
||
24 | |||
25 | public function withConfig(array $config): self |
||
31 | } |
||
32 | |||
33 | public function read(?SchemaProviderInterface $nextProvider = null): ?array |
||
34 | { |
||
35 | if (!is_file($this->file)) { |
||
36 | return null; |
||
37 | } |
||
38 | $schema = include $this->file; |
||
39 | return $schema !== null || $nextProvider === null ? $schema : $nextProvider->read(); |
||
40 | } |
||
41 | |||
42 | public function clear(): bool |
||
45 | } |
||
46 | } |
||
47 |