diff --git a/src/Event/Response/Diet.php b/src/Event/Response/Diet.php index fce10d2..0c1e35c 100644 --- a/src/Event/Response/Diet.php +++ b/src/Event/Response/Diet.php @@ -11,7 +11,7 @@ * @method static Diet VEGAN() * @method static Diet VEGETARIAN() */ -final class Diet extends Food +final class Diet extends Enum { use AutoInstances; diff --git a/src/Event/Response/Event.php b/src/Event/Response/Event.php index 157e17d..cd5ce9c 100644 --- a/src/Event/Response/Event.php +++ b/src/Event/Response/Event.php @@ -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 */ diff --git a/src/Event/Response/Food.php b/src/Event/Response/Food.php index 56d8ec1..162a9d3 100644 --- a/src/Event/Response/Food.php +++ b/src/Event/Response/Food.php @@ -12,7 +12,7 @@ * @method static Food MEAT() * @method static Food VEGAN() */ -abstract class Food extends Enum +final class Food extends Enum { use AutoInstances;