From 15e729cbe2b88eaf5f0a2f25dbd2302fc109aa31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Sat, 3 Oct 2026 10:01:56 +0200 Subject: [PATCH] style: prefix global PHP classes with backslash instead of importing them --- app/Exceptions/Crm/CrmAuthenticationFailedException.php | 4 +--- app/Exceptions/Crm/CrmCustomerExistsException.php | 4 +--- app/Exceptions/Crm/CrmCustomerNotActivatedException.php | 4 +--- app/Exceptions/CustomerNotEmployedException.php | 4 +--- app/Http/Requests/Fo/Auth/RegisterRequest.php | 3 +-- app/Lib/Helpers/ExceptionsHelper.php | 3 +-- app/Traits/Controllers/HasMassActions.php | 3 +-- 7 files changed, 7 insertions(+), 18 deletions(-) diff --git a/app/Exceptions/Crm/CrmAuthenticationFailedException.php b/app/Exceptions/Crm/CrmAuthenticationFailedException.php index 5529f7be..90d34a3d 100644 --- a/app/Exceptions/Crm/CrmAuthenticationFailedException.php +++ b/app/Exceptions/Crm/CrmAuthenticationFailedException.php @@ -4,9 +4,7 @@ declare(strict_types=1); namespace App\Exceptions\Crm; -use Exception; - -class CrmAuthenticationFailedException extends Exception +class CrmAuthenticationFailedException extends \Exception { /** @phpcs:disable */ public function __construct(string $message = 'CRM Authentication failed') diff --git a/app/Exceptions/Crm/CrmCustomerExistsException.php b/app/Exceptions/Crm/CrmCustomerExistsException.php index 2331f911..2a0b5233 100644 --- a/app/Exceptions/Crm/CrmCustomerExistsException.php +++ b/app/Exceptions/Crm/CrmCustomerExistsException.php @@ -4,9 +4,7 @@ declare(strict_types=1); namespace App\Exceptions\Crm; -use Exception; - -class CrmCustomerExistsException extends Exception +class CrmCustomerExistsException extends \Exception { /** @phpcs:disable */ public function __construct(string $message = 'CRM Customer already exists') diff --git a/app/Exceptions/Crm/CrmCustomerNotActivatedException.php b/app/Exceptions/Crm/CrmCustomerNotActivatedException.php index 5a6a3697..3deaf74c 100644 --- a/app/Exceptions/Crm/CrmCustomerNotActivatedException.php +++ b/app/Exceptions/Crm/CrmCustomerNotActivatedException.php @@ -4,9 +4,7 @@ declare(strict_types=1); namespace App\Exceptions\Crm; -use Exception; - -class CrmCustomerNotActivatedException extends Exception +class CrmCustomerNotActivatedException extends \Exception { /** @phpcs:disable */ public function __construct(string $message = 'CRM Customer is not activated') diff --git a/app/Exceptions/CustomerNotEmployedException.php b/app/Exceptions/CustomerNotEmployedException.php index d97b05e6..d9c2320b 100644 --- a/app/Exceptions/CustomerNotEmployedException.php +++ b/app/Exceptions/CustomerNotEmployedException.php @@ -4,8 +4,6 @@ declare(strict_types=1); namespace App\Exceptions; -use Exception; - -class CustomerNotEmployedException extends Exception +class CustomerNotEmployedException extends \Exception { } diff --git a/app/Http/Requests/Fo/Auth/RegisterRequest.php b/app/Http/Requests/Fo/Auth/RegisterRequest.php index 5e214d1a..768b625f 100644 --- a/app/Http/Requests/Fo/Auth/RegisterRequest.php +++ b/app/Http/Requests/Fo/Auth/RegisterRequest.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace App\Http\Requests\Fo\Auth; use App\Rules\Adult; -use DateTimeImmutable; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Illuminate\Validation\Rules\Password; @@ -46,7 +45,7 @@ class RegisterRequest extends FormRequest 'email' => $this->string('email')->value(), 'password' => $this->string('password')->value(), 'optin' => $this->boolean('optin'), - 'birth_date' => DateTimeImmutable::createFromFormat( + 'birth_date' => \DateTimeImmutable::createFromFormat( 'Y-m-d', $this->string('birth_date')->value() ) ?: throw new \InvalidArgumentException('Invalid birth date format'), diff --git a/app/Lib/Helpers/ExceptionsHelper.php b/app/Lib/Helpers/ExceptionsHelper.php index c0650d20..cdc33885 100644 --- a/app/Lib/Helpers/ExceptionsHelper.php +++ b/app/Lib/Helpers/ExceptionsHelper.php @@ -7,7 +7,6 @@ namespace App\Lib\Helpers; use Sentry\Event; use Sentry\ExceptionDataBag; use Sentry\Stacktrace; -use Throwable; /** * Provides utilities to sanitize and anonymize exceptions before reporting to Sentry. @@ -111,7 +110,7 @@ class ExceptionsHelper /** * Anonymize standard PHP stack trace. */ - public static function getAnonymizedStackTrace(Throwable $e): string + public static function getAnonymizedStackTrace(\Throwable $e): string { $projectPath = realpath(app_path('../')) ?: ''; $traceStr = ''; diff --git a/app/Traits/Controllers/HasMassActions.php b/app/Traits/Controllers/HasMassActions.php index 62e8e2dc..80fe50c3 100644 --- a/app/Traits/Controllers/HasMassActions.php +++ b/app/Traits/Controllers/HasMassActions.php @@ -10,7 +10,6 @@ use App\Interfaces\ModelWithStatus; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\DB; use Illuminate\Validation\ValidationException; -use Throwable; use UnexpectedValueException; /** @@ -85,7 +84,7 @@ trait HasMassActions }); } catch (ValidationException $e) { throw $e; - } catch (Throwable) { + } catch (\Throwable) { return back()->with('error', trans('crud.messages.cannot_be_updated')); } }