Completed
Push — master ( 025867...be698f )
by mingyoung
04:24 queued 10s
created

Application::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 8
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\Work\MiniProgram;
13
14
use EasyWeChat\MiniProgram\Application as MiniProgram;
15
use EasyWeChat\Work\Auth\AccessToken;
16
use EasyWeChat\Work\MiniProgram\Auth\Client;
17
18
/**
19
 * Class Application.
20
 *
21
 * @author Caikeal <[email protected]>
22
 *
23
 * @property \EasyWeChat\Work\MiniProgram\Auth\Client $auth
24
 */
25
class Application extends MiniProgram
26
{
27
    /**
28
     * Application constructor.
29
     *
30
     * @param array $config
31
     * @param array $prepends
32
     */
33
    public function __construct(array $config = [], array $prepends = [])
34
    {
35
        parent::__construct($config, $prepends + [
36
            'access_token' => function ($app) {
37
                return new AccessToken($app);
38
            },
39
            'auth' => function ($app) {
40
                return new Client($app);
41
            },
42
        ]);
43
    }
44
}
45