Completed
Pull Request — master (#1277)
by
unknown
03:17
created

Application::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 4
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the overtrue/wechat.
4
 *
5
 * (c) overtrue <[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 EasyWeChat\OpenWork\Work;
12
13
use EasyWeChat\OpenWork\Work\Auth\AccessToken;
14
use EasyWeChat\Work\Application as Work;
15
use \EasyWeChat\OpenWork\Application as OpenWork;
16
17
/**
18
 * Application.
19
 *
20
 * @author xiaomin <[email protected]>
21
 */
22
class Application extends Work
23
{
24
25
    /**
26
     * Application constructor.
27
     *
28
     * @param string   $auth_corpid
29
     * @param string   $permanent_code
30
     * @param OpenWork $component
31
     * @param array    $prepends
32
     */
33
    public function __construct(string $auth_corpid, string $permanent_code, OpenWork $component, array $prepends = [])
34
    {
35
        parent::__construct($component->getConfig(), $prepends + [
36
                'access_token' => function ($app) use ($auth_corpid, $permanent_code, $component) {
37
                    return new AccessToken($app, $auth_corpid, $permanent_code, $component);
38
                }
39
            ]);
40
    }
41
42
}