Passed
Pull Request — master (#662)
by Songda
06:50
created

UnipayServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Service;
6
7
use Yansongda\Pay\Contract\ParserInterface;
8
use Yansongda\Pay\Contract\ServiceProviderInterface;
9
use Yansongda\Pay\Parser\CollectionParser;
10
use Yansongda\Pay\Pay;
11
use Yansongda\Pay\Provider\Unipay;
12
13
class UnipayServiceProvider implements ServiceProviderInterface
14
{
15
    /**
16
     * @throws \Yansongda\Pay\Exception\ContainerException
17
     */
18
    public function register($data = null): void
19
    {
20
        $service = new Unipay();
21
22
        Pay::set(ParserInterface::class, CollectionParser::class);
23
        Pay::set(Unipay::class, $service);
24
        Pay::set('unipay', $service);
25
    }
26
}
27