1 | <?php |
||
25 | class ImportBuilder extends BaseBuilder |
||
26 | { |
||
27 | /** |
||
28 | * @param RuleInterface $rule |
||
29 | * @return bool |
||
30 | */ |
||
31 | public function match(RuleInterface $rule): bool |
||
35 | |||
36 | /** |
||
37 | * @param ContextInterface $ctx |
||
38 | * @param RuleInterface $rule |
||
39 | * @return \Generator|RecordInterface|TypeNameInterface|void |
||
40 | */ |
||
41 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
||
48 | |||
49 | /** |
||
50 | * @param ContextInterface $ctx |
||
51 | * @param ScalarInterface|RuleInterface $inclusion |
||
52 | * @return Readable |
||
53 | */ |
||
54 | private function include(ContextInterface $ctx, ScalarInterface $inclusion): Readable |
||
62 | |||
63 | /** |
||
64 | * @param ContextInterface $ctx |
||
65 | * @param ScalarInterface $inclusion |
||
66 | * @return Readable |
||
67 | * @throws FileNotReadableException |
||
68 | */ |
||
69 | private function tryOpen(ContextInterface $ctx, ScalarInterface $inclusion): Readable |
||
85 | |||
86 | /** |
||
87 | * @param Readable $file |
||
88 | * @param string $inclusion |
||
89 | * @return string |
||
90 | */ |
||
91 | private function getPathname(Readable $file, string $inclusion): string |
||
102 | } |
||
103 |