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

SearchOrdersApi::distillResponse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
nc 2
cc 2
eloc 4
nop 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