Completed
Pull Request — master (#29)
by Romain
02:25
created

CodeRequest::buildQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Kerox\Messenger\Request;
3
4
class CodeRequest extends AbstractRequest
5
{
6
7
    /**
8
     * @var int
9
     */
10
    protected $imageSize;
11
12
    /**
13
     * @var string
14
     */
15
    protected $codeType;
16
17
    /**
18
     * CodeRequest constructor.
19
     *
20
     * @param string $pageToken
21
     * @param int $imageSize
22
     * @param string $codeType
23
     */
24 1
    public function __construct(string $pageToken, int $imageSize, string $codeType)
25
    {
26 1
        parent::__construct($pageToken);
27
28 1
        $this->imageSize = $imageSize;
29 1
        $this->codeType = $codeType;
30 1
    }
31
32
    /**
33
     * @return array
34
     */
35 1
    protected function buildHeaders(): array
36
    {
37
        return [
38 1
            'Content-Type' => 'application/json',
39
        ];
40
    }
41
42
    /**
43
     * @return array
44
     */
45 1
    protected function buildBody(): array
46
    {
47
        $body = [
48 1
            'type' => $this->codeType,
49 1
            'image_size' => $this->imageSize,
50
        ];
51
52 1
        return array_filter($body);
53
    }
54
55
    /**
56
     * @return array
57
     */
58 1
    protected function buildQuery(): array
59
    {
60 1
        return parent::buildQuery();
61
    }
62
}