AppServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 2
1
<?php
2
/*
3
 * This file is part of the wannanbigpig/alipay-sdk-php.
4
 *
5
 * (c) wannanbigpig <[email protected]>
6
 *
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace EasyAlipay\Kernel\Providers;
12
13
use Pimple\Container;
14
use Pimple\ServiceProviderInterface;
15
16
/**
17
 * Class AppServiceProvider
18
 *
19
 * @author   liuml  <[email protected]>
20
 * @DateTime 2019-07-17  16:07
21
 */
22
class AppServiceProvider implements ServiceProviderInterface
23
{
24
    /**
25
     * Registers services on the given container.
26
     *
27
     * @param Container $pimple A container instance
28
     */
29 228
    public function register(Container $pimple)
30
    {
31 228
        foreach ($pimple['app_client_providers'] as $key => $value) {
32 196
            $pimple[$key] = function ($app) use ($value) {
33 30
                return new $value($app);
34 196
            };
35
        }
36 228
        $pimple->offsetUnset('app_client_providers');
37 228
    }
38
}
39