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

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

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
    protected $requestMethod = 'POST';
25
26
    /**
27
     * @var string
28
     */
29
    protected $endpointToGetToken = 'cgi-bin/service/get_provider_token';
30
31
    /**
32
     * @var string
33
     */
34
    protected $tokenKey = 'provider_access_token';
35
36
    /**
37
     * @var string
38
     */
39
    protected $cachePrefix = 'easywechat.kernel.provider_access_token.';
40
41
    /**
42
     * Credential for get token.
43
     *
44
     * @return array
45
     */
46
    protected function getCredentials(): array
47
    {
48
        return [
49
            'corpid'          => $this->app['config']['corp_id'], //服务商的corpid
50
            'provider_secret' => $this->app['config']['secret'],
51
        ];
52
    }
53
}