1 | <?php declare(strict_types = 1); |
||
17 | class XmlMetadataCollector extends AbstractMetadataCollector |
||
18 | { |
||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | */ |
||
22 | 2 | public function collect($xmlConfig, array $classesMetadata = []) : array |
|
39 | |||
40 | /** |
||
41 | * function xml2array |
||
42 | * |
||
43 | * This function is part of the PHP manual. |
||
44 | * |
||
45 | * The PHP manual text and comments are covered by the Creative Commons |
||
46 | * Attribution 3.0 License, copyright (c) the PHP Documentation Group |
||
47 | * |
||
48 | * @param \SimpleXMLElement|array $xmlObject |
||
49 | * @param array $out |
||
50 | * |
||
51 | * @return array XML converted array |
||
52 | * |
||
53 | * @author k dot antczak at livedata dot pl |
||
54 | * @date 2011-04-22 06:08 UTC |
||
55 | * @link http://www.php.net/manual/en/ref.simplexml.php#103617 |
||
56 | * @license http://www.php.net/license/index.php#doc-lic |
||
57 | * @license http://creativecommons.org/licenses/by/3.0/ |
||
58 | * @license CC-BY-3.0 <http://spdx.org/licenses/CC-BY-3.0> |
||
59 | */ |
||
60 | 2 | protected function xml2array($xmlObject, array $out = []) : array |
|
68 | } |
||
69 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: