mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-08-14 02:27:23 -07:00
spaces.php
This commit is contained in:
parent
7755490b81
commit
eefa32741e
845 changed files with 50409 additions and 0 deletions
36
aws/Aws/Api/Parser/RestXmlParser.php
Normal file
36
aws/Aws/Api/Parser/RestXmlParser.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\Service;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @internal Implements REST-XML parsing (e.g., S3, CloudFront, etc...)
|
||||
*/
|
||||
class RestXmlParser extends AbstractRestParser
|
||||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
/** @var XmlParser */
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param XmlParser $parser XML body parser
|
||||
*/
|
||||
public function __construct(Service $api, XmlParser $parser = null)
|
||||
{
|
||||
parent::__construct($api);
|
||||
$this->parser = $parser ?: new XmlParser();
|
||||
}
|
||||
|
||||
protected function payload(
|
||||
ResponseInterface $response,
|
||||
StructureShape $member,
|
||||
array &$result
|
||||
) {
|
||||
$xml = $this->parseXml($response->getBody());
|
||||
$result += $this->parser->parse($member, $xml);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue