Skip to content

Commit

Permalink
Merge pull request #42 from SoapBox/bugfix/php-72
Browse files Browse the repository at this point in the history
[Bugfix] PHP 7.2 Support
  • Loading branch information
Jaspaul authored Feb 26, 2018
2 parents 09f5669 + 92caea2 commit 2803cbd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ php:
- 7.1
- 7.2

matrix:
allow_failures:
- php: 7.2

before_script:
- composer self-update
- composer install --no-interaction
Expand Down
3 changes: 1 addition & 2 deletions src/Parsers/XmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

class XmlParser extends Parser
{

private $xml;

/**
Expand All @@ -23,7 +22,7 @@ private function objectify($value)
foreach ((array) $temp as $key => $value) {
if ($key === "@attributes") {
$result['_' . key($value)] = $value[key($value)];
} elseif (count($value) < 1) {
} elseif (is_array($value) && count($value) < 1) {
$result[$key] = '';
} else {
$result[$key] = (is_array($value) or is_object($value)) ? $this->objectify($value) : $value;
Expand Down

0 comments on commit 2803cbd

Please sign in to comment.