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\ScalarReducer::class, |
||
33 | Reducers\TypeHint\ArrayReducer::class, |
||
34 | Reducers\TypeHint\GenericReducer::class, |
||
35 | Reducers\TypeHint\DisjunctionReducer::class, |
||
36 | Reducers\TypeHint\ConjunctionReducer::class, |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * @var Parser |
||
41 | */ |
||
42 | private $parser; |
||
43 | |||
44 | /** |
||
45 | * @var array|ReducerInterface[] |
||
46 | */ |
||
47 | private $reducers = []; |
||
48 | |||
49 | /** |
||
50 | * Builder constructor. |
||
51 | */ |
||
52 | public function __construct() |
||
58 | |||
59 | /** |
||
60 | * @return void |
||
61 | */ |
||
62 | private function bootReducers(): void |
||
68 | |||
69 | /** |
||
70 | * @param string $class |
||
71 | * @return iterable|AttributeInterface[] |
||
72 | * @throws \RuntimeException |
||
73 | */ |
||
74 | public function buildClass(string $class): iterable |
||
84 | |||
85 | /** |
||
86 | * @param RuleInterface $rule |
||
87 | * @return mixed |
||
88 | * @throws \RuntimeException |
||
89 | */ |
||
90 | private function build(RuleInterface $rule) |
||
103 | |||
104 | /** |
||
105 | * @param \Generator $coroutine |
||
106 | * @return mixed |
||
107 | * @throws \RuntimeException |
||
108 | */ |
||
109 | private function coroutine(\Generator $coroutine) |
||
123 | } |
||
124 |