UserRequest::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Request;
6
7
class UserRequest extends AbstractRequest
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $fields;
13
14
    /**
15
     * UserRequest constructor.
16
     */
17 1
    public function __construct(string $pageToken, array $fields)
18
    {
19 1
        parent::__construct($pageToken);
20
21 1
        $this->fields = $fields;
22 1
    }
23
24 1
    protected function buildHeaders(): void
25
    {
26 1
    }
27
28 1
    protected function buildBody(): void
29
    {
30 1
    }
31
32 1
    protected function buildQuery(): array
33
    {
34 1
        $fields = implode(',', $this->fields);
35
36 1
        $query = parent::buildQuery();
37
        $query += [
38 1
            'fields' => $fields,
39
        ];
40
41 1
        return $query;
42
    }
43
}
44