Files
swiftadmin/vendor/yansongda/pay/src/Parser/CollectionParser.php

26 lines
653 B
PHP
Raw Normal View History

2022-08-19 19:48:37 +08:00
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Parser;
use Psr\Http\Message\ResponseInterface;
use Yansongda\Pay\Contract\ParserInterface;
use Yansongda\Pay\Pay;
use Yansongda\Supports\Collection;
class CollectionParser implements ParserInterface
{
/**
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
* @throws \Yansongda\Pay\Exception\ContainerException
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
*/
public function parse(?ResponseInterface $response): Collection
{
return new Collection(
Pay::get(ArrayParser::class)->parse($response)
);
}
}