Completed
Pull Request — master (#1414)
by milkmeowo
04:39
created

Application   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 15
ccs 4
cts 4
cp 1
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
/*
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\OpenWork\Work;
13
14
use EasyWeChat\OpenWork\Application as OpenWork;
15
use EasyWeChat\OpenWork\Work\Auth\AccessToken;
16
use EasyWeChat\Work\Application as Work;
17
18
/**
19
 * Application.
20
 *
21
 * @author xiaomin <[email protected]>
22
 */
23
class Application extends Work
24
{
25
    /**
26
     * Application constructor.
27
     *
28
     * @param string   $authCorpId
29
     * @param string   $permanentCode
30
     * @param OpenWork $component
31
     * @param array    $prepends
32
     */
33 1
    public function __construct(string $authCorpId, string $permanentCode, OpenWork $component, array $prepends = [])
34
    {
35 1
        parent::__construct($component->getConfig(), $prepends + [
36 1
                'access_token' => function ($app) use ($authCorpId, $permanentCode, $component) {
37 1
                    return new AccessToken($app, $authCorpId, $permanentCode, $component);
38 1
                },
39
            ]);
40 1
    }
41
}
42