From 9c2bb6266611bb70722c77152be06e3c534f2372 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Tue, 25 Aug 2026 18:16:54 +0700 Subject: [PATCH] fix: standardize closure syntax and ensure newline at end of file in multiple files --- app/Http/Controllers/Admin/Users/LecturerController.php | 2 +- app/Services/Admin/Master/AcademicTermService.php | 2 +- app/Services/Admin/Users/AdministratorService.php | 6 +++--- app/Services/Admin/Users/LecturerService.php | 8 ++++---- app/Services/Admin/Users/StudentService.php | 8 ++++---- tests/Feature/Auth/AuthenticationTest.php | 2 +- tests/Feature/Auth/EmailVerificationTest.php | 2 +- tests/Feature/Auth/PasswordConfirmationTest.php | 2 +- tests/Feature/Auth/PasswordResetTest.php | 2 +- tests/Feature/Auth/RegistrationTest.php | 2 +- tests/Feature/Auth/TwoFactorChallengeTest.php | 2 +- tests/Feature/Auth/VerificationNotificationTest.php | 2 +- tests/Feature/DashboardTest.php | 2 +- tests/Feature/ExampleTest.php | 2 +- tests/Unit/ExampleTest.php | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/Http/Controllers/Admin/Users/LecturerController.php b/app/Http/Controllers/Admin/Users/LecturerController.php index a4dca0e..fb217f2 100644 --- a/app/Http/Controllers/Admin/Users/LecturerController.php +++ b/app/Http/Controllers/Admin/Users/LecturerController.php @@ -66,7 +66,7 @@ public function destroy(User $user): RedirectResponse { $this->service->delete($user); - return Inertia::flash('toast', ['type' => 'success', 'message' => 'Dosen berhasil dihapus.'])->back(); + return Inertia::flash('toast', ['type' => 'success', 'message' => 'Dosen berhasil dihapus.'])->back(); } public function resetPassword(User $user): RedirectResponse diff --git a/app/Services/Admin/Master/AcademicTermService.php b/app/Services/Admin/Master/AcademicTermService.php index 36997c2..f01a134 100644 --- a/app/Services/Admin/Master/AcademicTermService.php +++ b/app/Services/Admin/Master/AcademicTermService.php @@ -17,7 +17,7 @@ public function paginated(int $perPage = 25, string $search = '', string $sort = { return AcademicTerm::query() ->select(['id', 'name', 'semester', 'start_date', 'end_date', 'is_active']) - ->when($search, fn($q) => $q->where('name', 'like', "%{$search}%")) + ->when($search, fn ($q) => $q->where('name', 'like', "%{$search}%")) ->orderBy($sort, $direction) ->paginate($perPage); } diff --git a/app/Services/Admin/Users/AdministratorService.php b/app/Services/Admin/Users/AdministratorService.php index ec8fad2..8745c40 100644 --- a/app/Services/Admin/Users/AdministratorService.php +++ b/app/Services/Admin/Users/AdministratorService.php @@ -12,11 +12,11 @@ class AdministratorService public function getPaginated(array $filters = []): LengthAwarePaginator { return User::with(['profile', 'roles']) - ->whereHas('roles', fn($q) => $q->whereIn('name', ['staff-admin', 'staff-keuangan'])) - ->when($filters['search'] ?? null, fn($q, $search) => $q->where(function ($query) use ($search) { + ->whereHas('roles', fn ($q) => $q->whereIn('name', ['staff-admin', 'staff-keuangan'])) + ->when($filters['search'] ?? null, fn ($q, $search) => $q->where(function ($query) use ($search) { $query->where('username', 'like', "%{$search}%") ->orWhere('email', 'like', "%{$search}%") - ->orWhereHas('profile', fn($q) => $q->where('full_name', 'like', "%{$search}%")); + ->orWhereHas('profile', fn ($q) => $q->where('full_name', 'like', "%{$search}%")); })) ->latest() ->paginate($filters['per_page'] ?? 25); diff --git a/app/Services/Admin/Users/LecturerService.php b/app/Services/Admin/Users/LecturerService.php index adcbaf3..8add062 100644 --- a/app/Services/Admin/Users/LecturerService.php +++ b/app/Services/Admin/Users/LecturerService.php @@ -19,12 +19,12 @@ public function getAllForSelect(): Collection public function getPaginated(array $filters = []): LengthAwarePaginator { return User::with(['profile', 'lecturer.department']) - ->whereHas('roles', fn($q) => $q->where('name', 'dosen')) - ->when($filters['search'] ?? null, fn($q, $search) => $q->where(function ($query) use ($search) { + ->whereHas('roles', fn ($q) => $q->where('name', 'dosen')) + ->when($filters['search'] ?? null, fn ($q, $search) => $q->where(function ($query) use ($search) { $query->where('username', 'like', "%{$search}%") ->orWhere('email', 'like', "%{$search}%") - ->orWhereHas('profile', fn($q) => $q->where('full_name', 'like', "%{$search}%")) - ->orWhereHas('lecturer', fn($q) => $q->where('lecturer_number', 'like', "%{$search}%")); + ->orWhereHas('profile', fn ($q) => $q->where('full_name', 'like', "%{$search}%")) + ->orWhereHas('lecturer', fn ($q) => $q->where('lecturer_number', 'like', "%{$search}%")); })) ->latest() ->paginate($filters['per_page'] ?? 25); diff --git a/app/Services/Admin/Users/StudentService.php b/app/Services/Admin/Users/StudentService.php index cfa9466..9e4923b 100644 --- a/app/Services/Admin/Users/StudentService.php +++ b/app/Services/Admin/Users/StudentService.php @@ -19,12 +19,12 @@ public function getAllForSelect(): Collection public function getPaginated(array $filters = []): LengthAwarePaginator { return User::with(['profile', 'student.department']) - ->whereHas('roles', fn($q) => $q->where('name', 'mahasiswa')) - ->when($filters['search'] ?? null, fn($q, $search) => $q->where(function ($query) use ($search) { + ->whereHas('roles', fn ($q) => $q->where('name', 'mahasiswa')) + ->when($filters['search'] ?? null, fn ($q, $search) => $q->where(function ($query) use ($search) { $query->where('username', 'like', "%{$search}%") ->orWhere('email', 'like', "%{$search}%") - ->orWhereHas('profile', fn($q) => $q->where('full_name', 'like', "%{$search}%")) - ->orWhereHas('student', fn($q) => $q->where('student_number', 'like', "%{$search}%")); + ->orWhereHas('profile', fn ($q) => $q->where('full_name', 'like', "%{$search}%")) + ->orWhereHas('student', fn ($q) => $q->where('student_number', 'like', "%{$search}%")); })) ->latest() ->paginate($filters['per_page'] ?? 25); diff --git a/tests/Feature/Auth/AuthenticationTest.php b/tests/Feature/Auth/AuthenticationTest.php index c404ceb..d1b9ed2 100644 --- a/tests/Feature/Auth/AuthenticationTest.php +++ b/tests/Feature/Auth/AuthenticationTest.php @@ -74,4 +74,4 @@ ]); $response->assertTooManyRequests(); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Auth/EmailVerificationTest.php b/tests/Feature/Auth/EmailVerificationTest.php index 6428476..81eacd8 100644 --- a/tests/Feature/Auth/EmailVerificationTest.php +++ b/tests/Feature/Auth/EmailVerificationTest.php @@ -98,4 +98,4 @@ Event::assertNotDispatched(Verified::class); expect($user->fresh()->hasVerifiedEmail())->toBeTrue(); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Auth/PasswordConfirmationTest.php b/tests/Feature/Auth/PasswordConfirmationTest.php index 819aac9..5d58992 100644 --- a/tests/Feature/Auth/PasswordConfirmationTest.php +++ b/tests/Feature/Auth/PasswordConfirmationTest.php @@ -19,4 +19,4 @@ $response = $this->get(route('password.confirm')); $response->assertRedirect(route('login')); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Auth/PasswordResetTest.php b/tests/Feature/Auth/PasswordResetTest.php index 5ce8fd7..a2b8010 100644 --- a/tests/Feature/Auth/PasswordResetTest.php +++ b/tests/Feature/Auth/PasswordResetTest.php @@ -75,4 +75,4 @@ ]); $response->assertSessionHasErrors('email'); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index abd8ab2..35ec7ca 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -22,4 +22,4 @@ $this->assertAuthenticated(); $response->assertRedirect(route('dashboard', absolute: false)); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Auth/TwoFactorChallengeTest.php b/tests/Feature/Auth/TwoFactorChallengeTest.php index c369db2..62e33d7 100644 --- a/tests/Feature/Auth/TwoFactorChallengeTest.php +++ b/tests/Feature/Auth/TwoFactorChallengeTest.php @@ -32,4 +32,4 @@ ->assertInertia(fn (Assert $page) => $page ->component('auth/two-factor-challenge'), ); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Auth/VerificationNotificationTest.php b/tests/Feature/Auth/VerificationNotificationTest.php index c6648ee..2e7c33f 100644 --- a/tests/Feature/Auth/VerificationNotificationTest.php +++ b/tests/Feature/Auth/VerificationNotificationTest.php @@ -31,4 +31,4 @@ ->assertRedirect(route('dashboard', absolute: false)); Notification::assertNothingSent(); -}); \ No newline at end of file +}); diff --git a/tests/Feature/DashboardTest.php b/tests/Feature/DashboardTest.php index d59d2d7..95c6a8b 100644 --- a/tests/Feature/DashboardTest.php +++ b/tests/Feature/DashboardTest.php @@ -13,4 +13,4 @@ $response = $this->get(route('dashboard')); $response->assertOk(); -}); \ No newline at end of file +}); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index a576279..ef7b533 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -4,4 +4,4 @@ $response = $this->get(route('home')); $response->assertOk(); -}); \ No newline at end of file +}); diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 27f3f87..44a4f33 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,4 +2,4 @@ test('that true is true', function () { expect(true)->toBeTrue(); -}); \ No newline at end of file +});