Skip to content

Commit

Permalink
Fait renvoyer array aux getters qui renvoient ?array (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca authored Nov 4, 2024
1 parent 81d6108 commit a5d191a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private function duplicateRegulationOrderRecord(
$generalInfo->organization = $organization;
$generalInfo->identifier = $identifier;
$generalInfo->description = $originalRegulationOrder->getDescription();
$generalInfo->additionalVisas = $originalRegulationOrder->getAdditionalVisas() ?? [];
$generalInfo->additionalReasons = $originalRegulationOrder->getAdditionalReasons() ?? [];
$generalInfo->additionalVisas = $originalRegulationOrder->getAdditionalVisas();
$generalInfo->additionalReasons = $originalRegulationOrder->getAdditionalReasons();
$generalInfo->visaModelUuid = $originalRegulationOrder->getVisaModel()?->getUuid();

return $this->commandBus->handle($generalInfo);
Expand Down
8 changes: 4 additions & 4 deletions src/Domain/Regulation/RegulationOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ public function getVisaModel(): ?VisaModel
return $this->visaModel;
}

public function getAdditionalVisas(): ?array
public function getAdditionalVisas(): array
{
return $this->additionalVisas;
return $this->additionalVisas ?? [];
}

public function getAdditionalReasons(): ?array
public function getAdditionalReasons(): array
{
return $this->additionalReasons;
return $this->additionalReasons ?? [];
}

public function update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function testRegulationFullyDuplicated(): void
$this->originalRegulationOrder
->expects(self::once())
->method('getAdditionalVisas')
->willReturn(null);
->willReturn([]);
$this->originalRegulationOrder
->expects(self::once())
->method('getVisaModel')
Expand Down

0 comments on commit a5d191a

Please sign in to comment.