Fixed static code analysis

This commit is contained in:
Constantin Graf
2024-05-29 17:59:41 +02:00
committed by Constantin Graf
parent 54d8c8a894
commit 09a79508ae

View File

@@ -215,7 +215,7 @@ class TimeEntryController extends Controller
throw new TimeEntryStillRunningApiException(); throw new TimeEntryStillRunningApiException();
} }
$client = $request->input('project_id') !== null ? Project::findOrFail($request->input('project_id'))->client : null; $client = $request->input('project_id') !== null ? Project::findOrFail((string) $request->input('project_id'))->client : null;
$timeEntry = new TimeEntry(); $timeEntry = new TimeEntry();
$timeEntry->fill($request->validated()); $timeEntry->fill($request->validated());
@@ -251,7 +251,7 @@ class TimeEntryController extends Controller
} }
if ($request->has('project_id')) { if ($request->has('project_id')) {
$client = $request->input('project_id') !== null ? Project::findOrFail($request->input('project_id'))->client : null; $client = $request->input('project_id') !== null ? Project::findOrFail((string) $request->input('project_id'))->client : null;
$timeEntry->client()->associate($client); $timeEntry->client()->associate($client);
} }
@@ -286,7 +286,7 @@ class TimeEntryController extends Controller
$client = null; $client = null;
$overwriteClient = false; $overwriteClient = false;
if ($request->has('changes.project_id')) { if ($request->has('changes.project_id')) {
$client = $request->input('changes.project_id') !== null ? Project::findOrFail($request->input('changes.project_id'))?->client : null; $client = $request->input('changes.project_id') !== null ? Project::findOrFail((string) $request->input('changes.project_id'))->client : null;
$overwriteClient = true; $overwriteClient = true;
} }