delete-functions-in-request-arr-get-replacement #24

Merged
Twyco merged 9 commits from delete-functions-in-request-arr-get-replacement into main 2026-04-11 12:51:57 +00:00
Owner

hab auch lokale variable genommen wenn öfters $request->user() genommen wurde oder andere ähnlcihe zugriffe da wo es sich gedopppelt hat

hab auch lokale variable genommen wenn öfters $request->user() genommen wurde oder andere ähnlcihe zugriffe da wo es sich gedopppelt hat
Eric added 2 commits 2026-04-03 14:51:11 +00:00
DEleted function in request and changed the way the controller uses it,
linter / quality (pull_request) Successful in 1m13s
tests / ci (8.4) (pull_request) Failing after 1m15s
1c355c20b4
Eric added 1 commit 2026-04-04 08:27:17 +00:00
See if this fixes the failing test
linter / quality (pull_request) Successful in 1m11s
tests / ci (8.4) (pull_request) Failing after 1m12s
50d787883c
Eric added 1 commit 2026-04-04 08:31:48 +00:00
See if this leads to the error
linter / quality (pull_request) Successful in 1m15s
tests / ci (8.4) (pull_request) Failing after 1m11s
2e78379b1a
Eric added 2 commits 2026-04-04 08:39:05 +00:00
Restored the updateProjectPermissions method
linter / quality (pull_request) Successful in 1m26s
tests / ci (8.4) (pull_request) Successful in 1m9s
30a07cb829
Eric added 1 commit 2026-04-04 08:42:54 +00:00
Check if this was not the error
linter / quality (pull_request) Successful in 1m15s
tests / ci (8.4) (pull_request) Successful in 1m19s
e0360ab6f0
Twyco requested changes 2026-04-04 09:54:22 +00:00
@@ -26,3 +27,4 @@
{
$user->forceFill([
'is_admin' => $request->boolean('is_admin'),
Owner

hier ist noch nen $request->boolean

hier ist noch nen $request->boolean
Owner

das geht so (glaube ich) nicht. Du kannst darfst das forceFill nciht entfernen, weil is_admin ist kein fillable, daher forceFill.

außerdem benutzt du jetzt $validated['is_admin'] statt Arr::get($validated, 'is_admin')

das geht so (glaube ich) nicht. Du kannst darfst das forceFill nciht entfernen, weil is_admin ist kein fillable, daher forceFill. außerdem benutzt du jetzt $validated['is_admin'] statt Arr::get($validated, 'is_admin')
@@ -115,1 +122,3 @@
$this->projectPermissionService->syncUserPermissions($project, $user, $request->permissions());
$validated = $request->validated();
$permissions = collect(Arr::get($validated, 'permissions'))
->map(fn (mixed $permission): string => (string) $permission)
Owner

das kann alles raus.

einfach distinct in die request packen und dann einfach nur:

$permissions = Arr::get($validated, 'permissions', [])

das kann alles raus. einfach **distinct** in die request packen und dann einfach nur: $permissions = Arr::get($validated, 'permissions', [])
Eric marked this conversation as resolved
@@ -132,0 +147,4 @@
->map(fn (mixed $permission): string => (string) $permission)
->unique()
->values()
->all();
Owner

selbe wie oben

selbe wie oben
Eric marked this conversation as resolved
@@ -23,1 +25,4 @@
{
$user = $request->user();
$session = $request->session();
Owner

hier brauchst du keine lokalen vars, beides wird ja nur einmal genutzt

hier brauchst du keine lokalen vars, beides wird ja nur einmal genutzt
Eric marked this conversation as resolved
@@ -45,0 +51,4 @@
$apiToken = Arr::get($validated, 'api_token');
$baseUrl = Arr::get($validated, 'base_url');
$provider = GitProviderKey::from((string) Arr::get($validated, 'provider'));
Owner

(string) cast kann weg, das validiert die request ja schon

(string) cast kann weg, das validiert die request ja schon
Eric marked this conversation as resolved
@@ -78,0 +91,4 @@
$validated = $request->validated();
$apiToken = Arr::get($validated, 'api_token');
$baseUrl = Arr::get($validated, 'base_url');
$provider = GitProviderKey::from((string) Arr::get($validated, 'provider'));
Owner

selbe hier mit cast

selbe hier mit cast
Eric marked this conversation as resolved
@@ -53,0 +53,4 @@
$validated = $request->validated();
$userIds = collect(Arr::get($validated, 'user_ids', []))
->map(fn (mixed $userId): int => (int) $userId)
Owner

hier auch einfach $userIds = Arr::get($validated, 'user_ids', []) und distinct ind request dazu

das collect->map->unique->values->all mach gar nichts.

hier auch einfach $userIds = Arr::get($validated, 'user_ids', []) und distinct ind request dazu das collect->map->unique->values->all mach gar nichts.
Owner

hier hast du vergessen distinct in die request reinzumachen

hier hast du vergessen distinct in die request reinzumachen
@@ -181,18 +181,6 @@ class UpdateProjectTicketRequest extends FormRequest
* value_user_id?: int|string|null
* }>
*/
Owner

php docs auch mit löschen

php docs auch mit löschen
Eric marked this conversation as resolved
@@ -32,12 +32,4 @@ class UpdateTeamMembersRequest extends FormRequest
/**
* @return array<int, int>
*/
Owner

hier auch php docs vergessen

hier auch php docs vergessen
Eric marked this conversation as resolved
Eric added 1 commit 2026-04-06 11:37:35 +00:00
Changes from the Pull request
tests / ci (8.4) (pull_request) Successful in 1m13s
linter / quality (pull_request) Successful in 1m10s
0743b7c26c
Twyco added 1 commit 2026-04-11 12:50:42 +00:00
fixes
linter / quality (pull_request) Successful in 1m16s
tests / ci (8.4) (pull_request) Successful in 1m26s
848f7694e6
Twyco merged commit 2b0b7bc2fe into main 2026-04-11 12:51:57 +00:00
Twyco deleted branch delete-functions-in-request-arr-get-replacement 2026-04-11 12:51:57 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: PetschStudios/KanbanGit#24