Skip to content

Commit

Permalink
fix fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
nkibardin committed May 26, 2023
1 parent fb7aa9c commit 99c0c7e
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 99c0c7e

Please sign in to comment.