#116 - cr fix
This commit is contained in:
@@ -16,6 +16,6 @@ class CalculateVacationDaysController extends Controller
|
||||
{
|
||||
$days = $calculator->calculateDays($request->from(), $request->to());
|
||||
|
||||
return new JsonResponse($days->map(fn(Carbon $day) => $day->toDateString())->all());
|
||||
return new JsonResponse($days->map(fn(Carbon $day): string => $day->toDateString())->all());
|
||||
}
|
||||
}
|
||||
|
@@ -21,8 +21,8 @@ class GetAvailableVacationTypesController extends Controller
|
||||
$user = User::query()->find($request->get("user"));
|
||||
|
||||
$types = VacationType::all()
|
||||
->filter(fn(VacationType $type) => $configRetriever->isAvailableFor($type, $user->profile->employment_form))
|
||||
->map(fn(VacationType $type) => [
|
||||
->filter(fn(VacationType $type): bool => $configRetriever->isAvailableFor($type, $user->profile->employment_form))
|
||||
->map(fn(VacationType $type): array => [
|
||||
"label" => $type->label(),
|
||||
"value" => $type->value,
|
||||
])
|
||||
|
@@ -35,8 +35,10 @@ class TimesheetController extends Controller
|
||||
|
||||
$types = VacationType::all()
|
||||
->filter(
|
||||
fn(VacationType $type) => $configRetriever->isAvailableFor($type, EmploymentForm::EmploymentContract)
|
||||
&& $configRetriever->isVacation($type),
|
||||
fn(VacationType $type): bool => $configRetriever->isAvailableFor(
|
||||
$type,
|
||||
EmploymentForm::EmploymentContract,
|
||||
) && $configRetriever->isVacation($type),
|
||||
);
|
||||
|
||||
$filename = "{$carbonMonth->translatedFormat("F Y")}.xlsx";
|
||||
|
@@ -30,7 +30,7 @@ class VacationLimitController extends Controller
|
||||
->sortBy(fn(VacationLimit $limit): string => "{$limit->user->profile->last_name} {$limit->user->profile->first_name}")
|
||||
->values();
|
||||
|
||||
$limitsResource = $limits->map(fn(VacationLimit $limit) => [
|
||||
$limitsResource = $limits->map(fn(VacationLimit $limit): array => [
|
||||
"id" => $limit->id,
|
||||
"user" => new UserResource($limit->user),
|
||||
"hasVacation" => $limit->hasVacation(),
|
||||
|
Reference in New Issue
Block a user