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

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCredentials() 0 6 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\SuiteAuth;
12
13
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...
14
15
/**
16
 * AccessToken.
17
 *
18
 * @author xiaomin <[email protected]>
19
 */
20
class AccessToken extends BaseAccessToken
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $requestMethod = 'POST';
26
27
    /**
28
     * @var string
29
     */
30
    protected $endpointToGetToken = 'cgi-bin/service/get_suite_token';
31
32
    /**
33
     * @var string
34
     */
35
    protected $tokenKey = 'suite_access_token';
36
37
    /**
38
     * @var string
39
     */
40
    protected $cachePrefix = 'easywechat.kernel.suite_access_token.';
41
42
    /**
43
     * Credential for get token.
44
     *
45
     * @return array
46
     */
47
    protected function getCredentials(): array
48
    {
49
        return [
50
            'suite_id'     => $this->app['config']['suite_id'],
51
            'suite_secret' => $this->app['config']['suite_secret'],
52
            'suite_ticket' => $this->app['suite_ticket']->getTicket()
53
        ];
54
    }
55
}