From 47b5abc0f134571e644650f4f2a1ceaa108bdd8e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 28 May 2025 22:34:13 +0200 Subject: [PATCH] Fix tests --- app/Prevention/Enums/Prevention.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Prevention/Enums/Prevention.php b/app/Prevention/Enums/Prevention.php index 0561a746..0bdbcafe 100644 --- a/app/Prevention/Enums/Prevention.php +++ b/app/Prevention/Enums/Prevention.php @@ -2,6 +2,7 @@ namespace App\Prevention\Enums; +use App\Prevention\Data\PreventionData; use Illuminate\Support\Collection; enum Prevention @@ -37,15 +38,15 @@ enum Prevention } /** - * @param array $preventions + * @param Collection $preventions * @return Collection */ - public static function items(array $preventions): Collection + public static function items(Collection $preventions): Collection { return collect(static::cases())->map(fn($case) => [ 'letter' => $case->letter(), - 'value' => !in_array($case, $preventions), - 'tooltip' => $case->tooltip(!in_array($case, $preventions)), + 'value' => $preventions->pluck('type')->doesntContain($case), + 'tooltip' => $case->tooltip($preventions->pluck('type')->doesntContain($case)), ]); } }