Test Failed
Push — develop ( cf0637...ea0f43 )
by Yuji
08:02
created

UpdateOrderStatusApi   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 3
dl 0
loc 40
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A distillResponse() 0 8 2
A httpMethod() 0 4 1
A path() 0 4 1
A expectsFormFields() 0 4 1
1
<?php
2
3
namespace Shippinno\YahooShoppingJp\Api;
4
5
use Shippinno\YahooShoppingJp\HttpMethod;
6
use Shippinno\YahooShoppingJp\Exception\DistillationException;
7
8
class UpdateOrderStatusApi extends AbstractApi
9
{
10
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function distillResponse(array $response): array
15
    {
16
        if (!isset($response['Result'])) {
17
            throw new DistillationException;
18
        }
19
20
        return $response;
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function httpMethod(): HttpMethod
27
    {
28
        return HttpMethod::POST();
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function path(): string
35
    {
36
        return 'orderStatusChange';
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function expectsFormFields(): bool
43
    {
44
        return false;
45
    }
46
47
}
48