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

UnipayServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 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