Completed
Pull Request — master (#1418)
by milkmeowo
03:01
created

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCredentials() 0 6 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\SuiteAuth;
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 $requestMethod = 'POST';
27
28
    /**
29
     * @var string
30
     */
31
    protected $endpointToGetToken = 'cgi-bin/service/get_suite_token';
32
33
    /**
34
     * @var string
35
     */
36
    protected $tokenKey = 'suite_access_token';
37
38
    /**
39
     * @var string
40
     */
41
    protected $cachePrefix = 'easywechat.kernel.suite_access_token.';
42
43
    /**
44
     * Credential for get token.
45
     *
46
     * @return array
47
     */
48 1
    protected function getCredentials(): array
49
    {
50
        return [
51 1
            'suite_id' => $this->app['config']['suite_id'],
52 1
            'suite_secret' => $this->app['config']['suite_secret'],
53 1
            'suite_ticket' => $this->app['suite_ticket']->getTicket(),
54
        ];
55
    }
56
}
57