Completed
Pull Request — master (#1275)
by
unknown
03:05
created

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 34
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
 * This file is part of the keacefull/wechat.
4
 *
5
 * (c) xiaomin <[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
class AccessToken extends BaseAccessToken
16
{
17
    /**
18
     * @var string
19
     */
20
    protected $requestMethod = 'POST';
21
22
    /**
23
     * @var string
24
     */
25
    protected $endpointToGetToken = 'cgi-bin/service/get_suite_token';
26
27
    /**
28
     * @var string
29
     */
30
    protected $tokenKey = 'suite_access_token';
31
32
    /**
33
     * @var string
34
     */
35
    protected $cachePrefix = 'easywechat.kernel.suite_access_token.';
36
37
38
    /**
39
     * Credential for get token.
40
     *
41
     * @return array
42
     */
43
    protected function getCredentials(): array
44
    {
45
        return [
46
            'suite_id'     => $this->app['config']['suite_id'],
47
            'suite_secret' => $this->app['config']['suite_secret'],
48
            'suite_ticket' => $this->app['suite_ticket']->getTicket()
49
        ];
50
    }
51
}