Skip to content

Commit

Permalink
fix BC for Food
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kurowski committed Jan 23, 2023
1 parent 1d16104 commit 97f409d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Event/Response/Diet.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @method static Diet VEGAN()
* @method static Diet VEGETARIAN()
*/
final class Diet extends Food
final class Diet extends Enum
{
use AutoInstances;

Expand Down
7 changes: 5 additions & 2 deletions src/Event/Response/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,14 @@ public function getAccommodation(): string

/**
* @deprecated use getPropagation()->getDiets() instead
* @return Diet[]
* @return Food[]
*/
public function getFood(): array
{
return $this->getPropagation()->getDiets();
return \array_map(
static fn(Diet $diet): Food => Food::fromScalar($diet->toScalar()),
$this->getPropagation()->getDiets(),
);
}

/** @deprecated use getPropagation()->getInvitationTextWorkDescription() instead */
Expand Down
2 changes: 1 addition & 1 deletion src/Event/Response/Food.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @method static Food MEAT()
* @method static Food VEGAN()
*/
abstract class Food extends Enum
final class Food extends Enum
{
use AutoInstances;

Expand Down

0 comments on commit 97f409d

Please sign in to comment.