Application::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 2
dl 0
loc 11
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\OpenPlatform\Authorizer\OfficialAccount;
13
14
use EasyWeChat\OfficialAccount\Application as OfficialAccount;
15
use EasyWeChat\OpenPlatform\Authorizer\Aggregate\AggregateServiceProvider;
16
17
/**
18
 * Class Application.
19
 *
20
 * @author mingyoung <[email protected]>
21
 *
22
 * @property \EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\Account\Client     $account
23
 * @property \EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\MiniProgram\Client $mini_program
24
 */
25
class Application extends OfficialAccount
26
{
27
    /**
28
     * Application constructor.
29
     *
30
     * @param array $config
31
     * @param array $prepends
32
     */
33 2
    public function __construct(array $config = [], array $prepends = [])
34
    {
35 2
        parent::__construct($config, $prepends);
36
37
        $providers = [
38 2
            AggregateServiceProvider::class,
39
            MiniProgram\ServiceProvider::class,
40
        ];
41
42 2
        foreach ($providers as $provider) {
43 2
            $this->register(new $provider());
44
        }
45 2
    }
46
}
47