Skip to content

Commit

Permalink
Исправлен атрибут в классе IFrameRequestDto
Browse files Browse the repository at this point in the history
  • Loading branch information
ePZuz committed Sep 13, 2024
1 parent a450421 commit 7640c58
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Dto/IFrameRequestDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@ class IFrameRequestDto implements WazzupRequestDtoInterface
public string $userName;
public string $scope = 'global';
public ?IFrameOptionsDto $options = null;
public ?IFrameFilterDto $filter = null;
public ?array $filter = [];

public function toArray(): array
{
$array = [
$result = [
'user' => [
'id' => $this->userId ?? null,
'name' => $this->userName ?? null,
],
'scope' => $this->scope,
];
if ($this->options !== null) {
$array['options'] = $this->options;
$result['options'] = $this->options;
}
if ($this->filter !== null) {
$array['filter'] = $this->filter;
if (!empty($this->filter)) {
$result['filter'] = $this->filter;
}
return $array;
return $result;
}

public function addFilter(IFrameFilterDto $filterDto): IFrameRequestDto
{
$this->filter[] = $filterDto;
return $this;
}
}

0 comments on commit 7640c58

Please sign in to comment.