Total Complexity | 10 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | final class SchemaCompiler |
||
14 | { |
||
15 | private const MEMORY_SECTION = 'cycle'; |
||
16 | private const EMPTY_SCHEMA = ':empty:'; |
||
17 | |||
18 | /** @var mixed */ |
||
19 | private $schema; |
||
20 | |||
21 | private function __construct($schema) |
||
22 | { |
||
23 | $this->schema = $schema; |
||
24 | } |
||
25 | |||
26 | public static function fromMemory(MemoryInterface $memory): self |
||
27 | { |
||
28 | return new self($memory->loadData(self::MEMORY_SECTION)); |
||
29 | } |
||
30 | |||
31 | public static function compile(Registry $registry, array $generators): self |
||
32 | { |
||
33 | return new self((new Compiler())->compile($registry, $generators)); |
||
34 | } |
||
35 | |||
36 | public function isEmpty(): bool |
||
39 | } |
||
40 | |||
41 | public function toSchema(): SchemaInterface |
||
44 | } |
||
45 | |||
46 | public function toMemory(MemoryInterface $memory) |
||
51 | ); |
||
52 | } |
||
53 | |||
54 | private function isWriteableSchema(): bool |
||
57 | } |
||
58 | } |
||
59 |