Passed
Push — master ( 96d02d...d08d15 )
by Songda
02:13 queued 10s
created

CollectionParser::unpack()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Parser;
6
7
use Psr\Http\Message\ResponseInterface;
8
use Yansongda\Pay\Contract\ParserInterface;
9
use Yansongda\Pay\Pay;
10
use Yansongda\Supports\Collection;
11
12
class CollectionParser implements ParserInterface
13
{
14
    /**
15
     * @throws \Yansongda\Pay\Exception\ContainerDependencyException
16
     * @throws \Yansongda\Pay\Exception\ContainerException
17
     * @throws \Yansongda\Pay\Exception\ServiceNotFoundException
18
     */
19
    public function parse(?ResponseInterface $response): Collection
20
    {
21
        return new Collection(
22
            Pay::get(ArrayParser::class)->parse($response)
23
        );
24
    }
25
}
26