first commit
This commit is contained in:
25
vendor/yansongda/pay/src/Parser/CollectionParser.php
vendored
Normal file
25
vendor/yansongda/pay/src/Parser/CollectionParser.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user