AlipayServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

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