| Total Complexity | 8 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 94.74% |
| 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 | 2 | public function __construct(string $pageToken, $profileSettings) |
|
| 27 | 2 | } |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @return null|array |
||
| 31 | */ |
||
| 32 | 2 | protected function buildHeaders(): ?array |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return null|array|\Kerox\Messenger\Model\ProfileSettings |
||
| 43 | */ |
||
| 44 | 2 | protected function buildBody() |
|
| 45 | { |
||
| 46 | 2 | $body = null; |
|
| 47 | 2 | if ($this->profileSettings instanceof ProfileSettings) { |
|
| 48 | 1 | $body = $this->profileSettings; |
|
| 49 | 1 | } elseif (\is_array($this->profileSettings)) { |
|
| 50 | $body = [ |
||
| 51 | 'fields' => $this->profileSettings, |
||
| 52 | ]; |
||
| 53 | } |
||
| 54 | |||
| 55 | 2 | return $body; |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return array |
||
| 60 | */ |
||
| 61 | 2 | protected function buildQuery(): array |
|
| 72 | } |
||
| 73 | } |
||
| 74 |