Conditions | 5 |
Paths | 7 |
Total Lines | 26 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 8.7091 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 1 | protected function _parse(&$variable) |
|
18 | { |
||
19 | try { |
||
20 | if ( |
||
21 | 1 | (string)$variable === $variable |
|
22 | 1 | && |
|
23 | 1 | 0 === strpos($variable, '<?xml') |
|
24 | 1 | ) { |
|
25 | $e = libxml_use_internal_errors(true); |
||
26 | $xml = simplexml_load_string($variable); |
||
27 | libxml_use_internal_errors($e); |
||
28 | if (empty($xml)) { |
||
29 | return false; |
||
30 | } |
||
31 | } else { |
||
32 | 1 | return false; |
|
33 | } |
||
34 | 1 | } catch (\Exception $e) { |
|
35 | 1 | return false; |
|
36 | } |
||
37 | |||
38 | $this->value = KintParser::factory($xml)->extendedValue; |
||
|
|||
39 | $this->type = 'XML'; |
||
40 | |||
41 | return true; |
||
42 | } |
||
43 | } |
||
44 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..