1 | <?php |
||
21 | class Builder |
||
22 | { |
||
23 | /** |
||
24 | * @var string[] |
||
25 | */ |
||
26 | private const DEFAULT_REDUCERS = [ |
||
27 | Reducers\DocBlockReducer::class, |
||
28 | Reducers\DocTitleReducer::class, |
||
29 | Reducers\VariableReducer::class, |
||
30 | Reducers\TypeHintReducer::class, |
||
31 | Reducers\TypeNameReducer::class, |
||
32 | Reducers\TypeHint\ScalarHintReducer::class, |
||
33 | Reducers\TypeHint\ArrayHintReducer::class, |
||
34 | Reducers\TypeHint\OrHintReducer::class, |
||
35 | Reducers\TypeHint\AndHintReducer::class, |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * @var Parser |
||
40 | */ |
||
41 | private $parser; |
||
42 | |||
43 | /** |
||
44 | * @var array|ReducerInterface[] |
||
45 | */ |
||
46 | private $reducers = []; |
||
47 | |||
48 | /** |
||
49 | * Builder constructor. |
||
50 | */ |
||
51 | public function __construct() |
||
57 | |||
58 | /** |
||
59 | * @return void |
||
60 | */ |
||
61 | private function bootReducers(): void |
||
67 | |||
68 | /** |
||
69 | * @param string $class |
||
70 | * @return iterable|AttributeInterface[] |
||
71 | * @throws \RuntimeException |
||
72 | */ |
||
73 | public function buildClass(string $class): iterable |
||
83 | |||
84 | /** |
||
85 | * @param RuleInterface $rule |
||
86 | * @return mixed |
||
87 | * @throws \RuntimeException |
||
88 | */ |
||
89 | private function build(RuleInterface $rule) |
||
102 | |||
103 | /** |
||
104 | * @param \Generator $coroutine |
||
105 | * @return mixed |
||
106 | * @throws \RuntimeException |
||
107 | */ |
||
108 | private function coroutine(\Generator $coroutine) |
||
122 | } |
||
123 |