Passed
Pull Request — master (#3)
by Alexandr
02:28 queued 41s
created

AbstractApiMethod::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace TheHorhe\ApiClient;
4
5
use GuzzleHttp\Psr7\Response;
6
use Psr\Http\Message\ResponseInterface;
7
8
abstract class AbstractApiMethod implements MethodInterface
9
{
10
    public function getHeaders()
11
    {
12
        return [];
13
    }
14
15
    public function getQueryParameters()
16
    {
17
        return [];
18
    }
19
20
    public function getHttpMethod()
21
    {
22
        return 'GET';
23
    }
24
25
    public function getScheme()
26
    {
27
        return 'https';
28
    }
29
30
    abstract public function getHost();
31
32
33
    abstract public function getMethodUrl();
34
35
    public function processResponse(ResponseInterface $response)
36
    {
37
        return $response;
38
    }
39
40
    public function handleException(\Throwable $exception)
41
    {
42
        throw $exception;
43
    }
44
45
    public function getBody()
46
    {
47
        return null;
48
    }
49
50
    public function getOptions()
51
    {
52
        return [
53
            'timeout' => 3
54
        ];
55
    }
56
}