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

CollectionDirection   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 4 1
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