diff --git a/src/RsvpResponse.php b/src/RsvpResponse.php new file mode 100644 index 0000000..4d5c6f9 --- /dev/null +++ b/src/RsvpResponse.php @@ -0,0 +1,11 @@ + 'matthew s.', 'response' => 'yes'], - ['name' => 'Michael P.', 'response' => 'yes'], - ['name' => 'Kathryn "Kat" R.', 'response' => 'yes'], - ['name' => 'Did not attend', 'response' => 'no'], + ['name' => 'matthew s.', 'response' => RsvpResponse::RESPONSE_YES], + ['name' => 'Michael P.', 'response' => RsvpResponse::RESPONSE_YES], + ['name' => 'Kathryn "Kat" R.', 'response' => RsvpResponse::RESPONSE_YES], + ['name' => 'Did not attend', 'response' => RsvpResponse::RESPONSE_NO], ]; public function getConfirmedAttendees(): Collection { return Collection::make(self::$rsvps) - ->filter(fn (array $attendee): bool => $attendee['response'] == 'yes') + ->filter(fn (array $attendee): bool => $attendee['response'] + == RsvpResponse::RESPONSE_YES) ; } }