Passed
Push — main ( 2267ed...383a90 )
by Abbotton
11:13
created

FreightTemplate   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A update() 0 3 1
A list() 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 FreightTemplate extends BaseRequest
9
{
10
    /**
11
     * 更新运费模板.
12
     *
13
     * @param  array  $params
14
     *
15
     * @return array
16
     * @throws RequestException
17
     *
18
     * @throws InvalidArgumentException
19
     */
20
    public function update(array $params): array
21
    {
22
        return $this->httpPost('freightTemplate/update', $params);
23
    }
24
25
    /**
26
     * 创建运费模板.
27
     *
28
     * @param  array  $params
29
     *
30
     * @return array
31
     * @throws RequestException
32
     *
33
     * @throws InvalidArgumentException
34
     */
35
    public function create(array $params): array
36
    {
37
        return $this->httpPost('freightTemplate/create', $params);
38
    }
39
40
    /**
41
     * 运费模板查询.
42
     *
43
     * @param  array  $params
44
     *
45
     * @return array
46
     * @throws InvalidArgumentException
47
     *
48
     * @throws RequestException
49
     */
50
    public function list(array $params = []): array
51
    {
52
        return $this->httpPost('freightTemplate/list', $params);
53
    }
54
}
55