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

CollectionParser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

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\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