Completed
Push — master ( 2addb1...4d5931 )
by Carlos
08:01 queued 02:29
created

Application   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
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
     * Application constructor.
26
     *
27
     * @param string   $authCorpId
28
     * @param string   $permanentCode
29
     * @param OpenWork $component
30
     * @param array    $prepends
31
     */
32
    public function __construct(string $authCorpId, string $permanentCode, OpenWork $component, array $prepends = [])
33
    {
34
        parent::__construct($component->getConfig(), $prepends + [
35
                'access_token' => function ($app) use ($authCorpId, $permanentCode, $component) {
36
                    return new AccessToken($app, $authCorpId, $permanentCode, $component);
37
                }
38
            ]);
39
    }
40
}
41