UserRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 37
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A buildHeaders() 0 3 1
A buildBody() 0 3 1
A buildQuery() 0 11 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