1 | <?php |
||
54 | class ContainerBuilder |
||
55 | { |
||
56 | /** |
||
57 | * The Map that should return definitions from an Xml file |
||
58 | * @var Map |
||
59 | */ |
||
60 | protected $map; |
||
61 | |||
62 | /** |
||
63 | * Constructor |
||
64 | * |
||
65 | * If no Map is specified, the builder will use the ContainerXmlMap. |
||
66 | * |
||
67 | * @param null|Map $map The Xml Map used to parse the Xml file |
||
68 | * |
||
69 | * @return void |
||
|
|||
70 | */ |
||
71 | public function __construct(Map $map = null) |
||
79 | |||
80 | /** |
||
81 | * Registers Xml definitions to the provided Container. |
||
82 | * If no Container is provided, a new one will be created. |
||
83 | * |
||
84 | * @param string|XmlFile $file Path to Xml (or XmlFile instance) |
||
85 | * @param null|Container $container Container where definitions are added |
||
86 | * |
||
87 | * @return Container |
||
88 | */ |
||
89 | public function execute($file, Container $container = null) |
||
109 | |||
110 | |||
111 | /** |
||
112 | * Converts XML definitions from parsing results |
||
113 | * |
||
114 | * @param array $inis Parsing results |
||
115 | * @param Container $container The Di Container |
||
116 | * @param XmlFile $file The XmlFile instance |
||
117 | * |
||
118 | * @return void |
||
119 | */ |
||
120 | protected function applyIniFiles(array $inis, Container $container, |
||
134 | |||
135 | /** |
||
136 | * Converts XML definitions from parsing results |
||
137 | * |
||
138 | * @param array $definitions Parsing results |
||
139 | * @param Container $container The Di Container |
||
140 | * |
||
141 | * @return void |
||
142 | */ |
||
143 | protected function applyDefinitions(array $definitions, |
||
153 | |||
154 | /** |
||
155 | * Converts XML class definitions from parsing results |
||
156 | * |
||
157 | * @param array $classDefs Parsing results |
||
158 | * @param Container $container The Di Container |
||
159 | * |
||
160 | * @return void |
||
161 | */ |
||
162 | protected function applyClassDefinitions(array $classDefs, |
||
186 | |||
187 | /** |
||
188 | * Converts XML Array definitions from parsing results |
||
189 | * |
||
190 | * @param array $arrayDefs Parsing results |
||
191 | * @param Container $container The Di Container |
||
192 | * |
||
193 | * @return void |
||
194 | */ |
||
195 | protected function applyArrayDefinitions(array $arrayDefs, |
||
219 | |||
220 | /** |
||
221 | * Converts XML definitions from parsing results |
||
222 | * |
||
223 | * @param array $listeners Parsing results |
||
224 | * @param Container $container The Di Container |
||
225 | * |
||
226 | * @return void |
||
227 | */ |
||
228 | protected function applyListeners(array $listeners, Container $container) |
||
250 | |||
251 | /** |
||
252 | * Transforms a string to a type, if known: |
||
253 | * |
||
254 | * - boolean: true / false |
||
255 | * - null: null |
||
256 | * |
||
257 | * @param string $value The initial string value |
||
258 | * |
||
259 | * @return null|string|boolean |
||
260 | */ |
||
261 | protected function transformValueType($value) |
||
274 | |||
275 | /** |
||
276 | * Returns the Xml Map |
||
277 | * |
||
278 | * @return Map |
||
279 | */ |
||
280 | public function getMap() |
||
284 | |||
285 | /** |
||
286 | * Defines the Xml Map used to parse definitions from the Xml file |
||
287 | * |
||
288 | * @param Map $map The Xml Map |
||
289 | * |
||
290 | * @return void |
||
291 | */ |
||
292 | public function setMap(Map $map) |
||
296 | } |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.