Total Complexity | 8 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class ProfileRequest extends AbstractRequest |
||
10 | { |
||
11 | /** |
||
12 | * @var mixed |
||
13 | */ |
||
14 | protected $profileSettings; |
||
15 | |||
16 | /** |
||
17 | * ProfileRequest constructor. |
||
18 | * |
||
19 | * @param string $pageToken |
||
20 | * @param mixed $profileSettings |
||
21 | */ |
||
22 | 3 | public function __construct(string $pageToken, $profileSettings) |
|
27 | 3 | } |
|
28 | |||
29 | /** |
||
30 | * @return null|array |
||
31 | */ |
||
32 | 3 | protected function buildHeaders(): ?array |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return null|array|\Kerox\Messenger\Model\ProfileSettings |
||
43 | */ |
||
44 | 3 | protected function buildBody() |
|
45 | { |
||
46 | 3 | $body = null; |
|
47 | 3 | if ($this->profileSettings instanceof ProfileSettings) { |
|
48 | 1 | $body = $this->profileSettings; |
|
49 | 2 | } elseif (\is_array($this->profileSettings)) { |
|
50 | $body = [ |
||
51 | 1 | 'fields' => $this->profileSettings, |
|
52 | ]; |
||
53 | } |
||
54 | |||
55 | 3 | return $body; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return array |
||
60 | */ |
||
61 | 3 | protected function buildQuery(): array |
|
72 | } |
||
73 | } |
||
74 |