Fix tests
This commit is contained in:
parent
ea79290435
commit
47b5abc0f1
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Prevention\Enums;
|
namespace App\Prevention\Enums;
|
||||||
|
|
||||||
|
use App\Prevention\Data\PreventionData;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
enum Prevention
|
enum Prevention
|
||||||
|
@ -37,15 +38,15 @@ enum Prevention
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<int, self> $preventions
|
* @param Collection<int, PreventionData> $preventions
|
||||||
* @return Collection<int, array{letter: string, value: bool, tooltip: string}>
|
* @return Collection<int, array{letter: string, value: bool, tooltip: string}>
|
||||||
*/
|
*/
|
||||||
public static function items(array $preventions): Collection
|
public static function items(Collection $preventions): Collection
|
||||||
{
|
{
|
||||||
return collect(static::cases())->map(fn($case) => [
|
return collect(static::cases())->map(fn($case) => [
|
||||||
'letter' => $case->letter(),
|
'letter' => $case->letter(),
|
||||||
'value' => !in_array($case, $preventions),
|
'value' => $preventions->pluck('type')->doesntContain($case),
|
||||||
'tooltip' => $case->tooltip(!in_array($case, $preventions)),
|
'tooltip' => $case->tooltip($preventions->pluck('type')->doesntContain($case)),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue