Skip to content

Commit

Permalink
Merge branch 'hotfix/KOMMO-854' into 'master'
Browse files Browse the repository at this point in the history
fix fatal

See merge request amocrm/amocrm-api-php!24
  • Loading branch information
Nikita committed May 29, 2023
2 parents fb7aa9c + 99c0c7e commit 77c5961
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/AmoCRM/Models/Sources/SourceServiceModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ public static function fromArray(array $data): self

public function toArray(): array
{
return [
'type' => $this->getType(),
$result = [
'type' => $this->getType(),
'pages' => $this->getPages()->toArray(),
'params' => $this->getParams()->toArray(),
'params' => [],
];
if ($this->getParams() !== null) {
$result['params'] = $this->getParams()->toArray();
}

return $result;
}

public function toApi(string $requestId = null): array
Expand Down

0 comments on commit 77c5961

Please sign in to comment.