Passed
Push — main ( 33cb0c...67dbd0 )
by Abbotton
10:38
created

Token   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 26
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A refresh() 0 3 1
1
<?php
2
3
namespace Abbotton\DouDian\Api;
4
5
use Illuminate\Http\Client\RequestException;
6
use Psr\SimpleCache\InvalidArgumentException;
7
8
class Token extends BaseRequest
9
{
10
    /**
11
     * 生成token API.
12
     *
13
     * @param  array  $params
14
     * @return array
15
     * @throws InvalidArgumentException
16
     * @throws RequestException
17
     */
18
    public function create(array $params): array
19
    {
20
        return $this->httpPost('token/create', $params);
21
    }
22
23
    /**
24
     * 刷新 token API.
25
     *
26
     * @param  array  $params
27
     * @return array
28
     * @throws InvalidArgumentException
29
     * @throws RequestException
30
     */
31
    public function refresh(array $params): array
32
    {
33
        return $this->httpPost('token/refresh', $params);
34
    }
35
}
36