Test Failed
Pull Request — master (#19)
by Aya
04:08
created

SearchOrdersApi   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 38
rs 10
c 0
b 0
f 0

4 Methods

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