1 | <?php |
||
15 | class ContainerBuilder |
||
16 | { |
||
17 | /** |
||
18 | * @var ArrayObject |
||
19 | */ |
||
20 | private $definitions; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $useAutowiring; |
||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $useAnnotations = false; |
||
31 | |||
32 | 21 | public function __construct() |
|
36 | |||
37 | /** |
||
38 | * @param bool $useAutowiring |
||
39 | */ |
||
40 | 21 | public function useAutowiring(bool $useAutowiring): void |
|
41 | { |
||
42 | 21 | $this->useAutowiring = $useAutowiring; |
|
43 | 21 | } |
|
44 | |||
45 | /** |
||
46 | * @return bool |
||
47 | */ |
||
48 | 20 | private function hasAutowiringEnabled(): bool |
|
49 | { |
||
50 | 20 | return $this->useAutowiring; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param bool $useAnnotations |
||
55 | */ |
||
56 | 1 | public function useAnnotations(bool $useAnnotations): void |
|
57 | { |
||
58 | 1 | $this->useAnnotations = $useAnnotations; |
|
59 | 1 | } |
|
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | 20 | private function hasAnnotationsEnabled(): bool |
|
65 | { |
||
66 | 20 | return $this->useAnnotations; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * @param array $definitions |
||
71 | * |
||
72 | * @throws ContainerException |
||
73 | */ |
||
74 | 15 | public function addDefinitions(array $definitions): void |
|
84 | |||
85 | /** |
||
86 | * @return ArrayObject |
||
87 | */ |
||
88 | 20 | private function getDefinitions(): ArrayObject |
|
92 | |||
93 | /** |
||
94 | * @return Container |
||
95 | */ |
||
96 | 20 | public function build(): Container |
|
107 | |||
108 | /** |
||
109 | * @return void |
||
110 | */ |
||
111 | 21 | private function init(): void |
|
116 | |||
117 | /** |
||
118 | * @return void |
||
119 | */ |
||
120 | 20 | private function reset(): void |
|
124 | } |
||
125 |