Passed
Push — master ( 7ef1e6...041b4f )
by Songda
02:07 queued 15s
created

CollectionDirection::parse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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