Skip to content

Commit

Permalink
Fix phpstan reported error in Xml class.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Aug 21, 2017
1 parent b387608 commit dcf59f7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Utility/Xml.php
Expand Up @@ -328,8 +328,20 @@ protected static function _fromArray($dom, $node, &$data, $format)
*/
protected static function _createChild($data)
{
$value = $dom = $key = $format = $node = null;
extract($data);
$data += [
'dom' => null,
'node' => null,
'key' => null,
'value' => null,
'format' => null,
];

$value = $data['value'];
$dom = $data['dom'];
$key = $data['key'];
$format = $data['format'];
$node = $data['node'];

$childNS = $childValue = null;
if (is_object($value) && method_exists($value, 'toArray') && is_callable([$value, 'toArray'])) {
$value = call_user_func([$value, 'toArray']);
Expand Down

0 comments on commit dcf59f7

Please sign in to comment.