Completed
Pull Request — master (#1418)
by milkmeowo
04:24 queued 01:28
created

AccessToken::getCredentials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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