1 | <?php |
||
17 | class Xml implements ParserInterface |
||
18 | { |
||
19 | /** |
||
20 | * {@inheritDoc} |
||
21 | * Parses an XML file as an array |
||
22 | * |
||
23 | * @throws ParseException If there is an error parsing the XML file |
||
24 | */ |
||
25 | 6 | public function parseFile($filename) |
|
26 | { |
||
27 | 6 | libxml_use_internal_errors(true); |
|
28 | 6 | $data = simplexml_load_file($filename, null, LIBXML_NOERROR); |
|
29 | 6 | return $this->parse($data, $filename); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritDoc} |
||
34 | * Parses an XML string as an array |
||
35 | * |
||
36 | * @throws ParseException If there is an error parsing the XML string |
||
37 | */ |
||
38 | 3 | public function parseString($config) |
|
44 | |||
45 | /** |
||
46 | * Completes parsing of XML data |
||
47 | * |
||
48 | * @param array $data |
||
49 | * @param strring $filename |
||
50 | * |
||
51 | * @throws ParseException If there is an error parsing the XML data |
||
52 | */ |
||
53 | 6 | protected function parse($data = null, $filename = null) |
|
72 | |||
73 | /** |
||
74 | * {@inheritDoc} |
||
75 | */ |
||
76 | 3 | public static function getSupportedExtensions() |
|
80 | } |
||
81 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: