Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
f71e9dbe4d
@ -143,7 +143,7 @@ trait MALTrait {
|
|||||||
{
|
{
|
||||||
if ($logger)
|
if ($logger)
|
||||||
{
|
{
|
||||||
$logger->warning('Non 200 response for api call', $response->getBody());
|
$logger->warning('Non 200 response for api call', (array)$response->getBody());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ trait MALTrait {
|
|||||||
{
|
{
|
||||||
if ($logger)
|
if ($logger)
|
||||||
{
|
{
|
||||||
$logger->warning('Non 201 response for POST api call', $response->getBody());
|
$logger->warning('Non 201 response for POST api call', (array)$response->getBody());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace Aviat\AnimeClient\API;
|
namespace Aviat\AnimeClient\API;
|
||||||
|
|
||||||
use DOMDocument, DOMNode, DOMNodeList;
|
use DOMDocument, DOMNode, DOMNodeList, InvalidArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XML <=> PHP Array codec
|
* XML <=> PHP Array codec
|
||||||
@ -115,7 +115,13 @@ class XML {
|
|||||||
$xml = static::stripXMLWhitespace($xml);
|
$xml = static::stripXMLWhitespace($xml);
|
||||||
|
|
||||||
$dom = new DOMDocument();
|
$dom = new DOMDocument();
|
||||||
$dom->loadXML($xml);
|
$hasLoaded = @$dom->loadXML($xml);
|
||||||
|
|
||||||
|
if ( ! $hasLoaded)
|
||||||
|
{
|
||||||
|
throw new InvalidArgumentException('Failed to load XML');
|
||||||
|
}
|
||||||
|
|
||||||
$root = $dom->documentElement;
|
$root = $dom->documentElement;
|
||||||
|
|
||||||
$data[$root->tagName] = [];
|
$data[$root->tagName] = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user