Passed
Pull Request — master (#1278)
by
unknown
03:33
created

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCredentials() 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\Auth;
13
14
use  EasyWeChat\Kernel\AccessToken as BaseAccessToken;
0 ignored issues
show
Coding Style introduced by
There must be a single space after the USE keyword
Loading history...
15
16
/**
17
 * AccessToken.
18
 *
19
 * @author xiaomin <[email protected]>
20
 */
21
class AccessToken extends BaseAccessToken
22
{
23
    /**
24
     * @var string
25
     */
26
    protected $endpointToGetToken = 'cgi-bin/service/get_provider_token';
27
28
    /**
29
     * @var string
30
     */
31
    protected $tokenKey = 'provider_access_token';
32
33
    /**
34
     * @var string
35
     */
36
    protected $cachePrefix = 'easywechat.kernel.provider_access_token.';
37
38
    /**
39
     * Credential for get token.
40
     *
41
     * @return array
42
     */
43
    protected function getCredentials(): array
44
    {
45
        return [
46
            'corpid'          => $this->app['config']['corp_id'], //服务商的corpid
47
            'provider_secret' => $this->app['config']['secret'],
48
        ];
49
    }
50
}