From d6fc06e032e294ea04f6d10dd6557f2e5cdfe8eb Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Wed, 15 Apr 2026 11:44:56 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=9A=A8=20resolve=20some=20phpcs/ph?= =?UTF-8?q?pstan=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Fo/CustomerController.php | 10 ++++++---- app/Http/Controllers/Fo/ParticipateController.php | 1 - .../Requests/Fo/Customers/CreateAccountRequest.php | 2 +- app/Lib/Helpers/ToolboxHelper.php | 2 +- app/Notifications/Customer/HasWonDiscount.php | 4 ++-- config/sentry.php | 4 ++-- phpstan.neon | 3 +-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/Fo/CustomerController.php b/app/Http/Controllers/Fo/CustomerController.php index 6bf1531..ec601d7 100644 --- a/app/Http/Controllers/Fo/CustomerController.php +++ b/app/Http/Controllers/Fo/CustomerController.php @@ -129,12 +129,14 @@ class CustomerController extends Controller $mesBr = app('mesBrAPI'); $brBasket = $mesBr->getBasket($crmUser); if (!empty($brBasket['coupons'])) { - $canPrint = (collect($brBasket['coupons'])->sum('quantity') - collect($brBasket['coupons'])->sum('printed')); + $canPrint = ( + collect($brBasket['coupons'])->sum('quantity') - collect($brBasket['coupons'])->sum('printed') + ); } - + $winningList = $customer->participations() - ->with(['instantWin'])->where(function (Builder $q) { - $q->whereHas('instantWin'); + ->with(['instantWin'])->where(function (Builder $query) { + $query->whereHas('instantWin'); })->get(); return view('theme::pages.participation.winning-participations', compact('winningList', 'canPrint')); diff --git a/app/Http/Controllers/Fo/ParticipateController.php b/app/Http/Controllers/Fo/ParticipateController.php index df8d222..f1537f1 100644 --- a/app/Http/Controllers/Fo/ParticipateController.php +++ b/app/Http/Controllers/Fo/ParticipateController.php @@ -10,7 +10,6 @@ use App\Mail\Won\PrizeWonAdminMail; use App\Models\Customer; use App\Models\InstantWin; use App\Models\Participation; -use App\Models\Discount; use App\Notifications\Customer\HasWonDiscount; use App\Notifications\Customer\HasWonInstantWin; use App\Repositories\Fo\CrmRepository; diff --git a/app/Http/Requests/Fo/Customers/CreateAccountRequest.php b/app/Http/Requests/Fo/Customers/CreateAccountRequest.php index 8a4a290..e910e28 100644 --- a/app/Http/Requests/Fo/Customers/CreateAccountRequest.php +++ b/app/Http/Requests/Fo/Customers/CreateAccountRequest.php @@ -196,7 +196,7 @@ class CreateAccountRequest extends FormRequest ]), ] ), - }; //end match + }; // end match return $messages; } diff --git a/app/Lib/Helpers/ToolboxHelper.php b/app/Lib/Helpers/ToolboxHelper.php index 661c4c4..3f1ccb0 100644 --- a/app/Lib/Helpers/ToolboxHelper.php +++ b/app/Lib/Helpers/ToolboxHelper.php @@ -97,7 +97,7 @@ class ToolboxHelper Validator::validate($request->all(), [ 'g-recaptcha-response' => [ 'required', 'string', - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed + // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed function ($attribute, $value, $fail) use ($isV3) { try { $response = Http::asForm()->post('https://www.google.com/recaptcha/api/siteverify', [ diff --git a/app/Notifications/Customer/HasWonDiscount.php b/app/Notifications/Customer/HasWonDiscount.php index a6c2869..2594a5c 100644 --- a/app/Notifications/Customer/HasWonDiscount.php +++ b/app/Notifications/Customer/HasWonDiscount.php @@ -17,8 +17,8 @@ class HasWonDiscount extends Notification implements ShouldQueue /** * Create a new notification instance. * - * @param Discount $discount The discount as set in Settings. - * @param string $first_name The client first name. + * @param \App\Lib\Discount $discount The discount as set in Settings. + * @param string $first_name The client first name. * @return void */ public function __construct( diff --git a/config/sentry.php b/config/sentry.php index 2e47564..3d0ed01 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -51,10 +51,10 @@ return [ 'missing_routes' => false, ], - // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii. + // See: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii. 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), - // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate. + // See: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate. 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), 'before_send' => [\App\Lib\Helpers\ExceptionsHelper::class, 'sentryEventHandler'], diff --git a/phpstan.neon b/phpstan.neon index b10f8f8..66f6154 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,5 +9,4 @@ parameters: excludePaths: - app/Lib/vendor/ - # Level 9 is the highest level - level: 5 + level: 7