Description
When checking out the 1.x branch of laravel/fortify and running the official lint command (composer lint), the static analysis fails with exit code 1.
This is because Laravel\Fortify\Http\Responses\LockoutResponse references Illuminate\Http\Response::HTTP_TOO_MANY_REQUESTS, which is undefined in Illuminate\Http\Response's class definition without Larastan's helper mappings.
Steps To Reproduce
- Clone the repository and checkout the
1.x branch.
- Run
composer install.
- Run
composer lint (which triggers phpstan analyse).
Actual Behavior
The analysis fails with the following output:
------ ---------------------------------------------------
Line src/Http/Responses/LockoutResponse.php
------ ---------------------------------------------------
49 Access to undefined constant
Illuminate\Http\Response::HTTP_TOO_MANY_REQUESTS.
------ ---------------------------------------------------
[ERROR] Found 1 error
Script @php vendor/bin/phpstan analyse handling the lint event returned with error code 1
Proposed Solution
We can replace the undefined constant Response::HTTP_TOO_MANY_REQUESTS with the direct HTTP status code 429 (which represents "Too Many Requests"). This resolves the PHPStan class constant resolution error and allows composer lint to pass successfully:
- ])->status(Response::HTTP_TOO_MANY_REQUESTS);
+ ])->status(429);
Description
When checking out the
1.xbranch oflaravel/fortifyand running the official lint command (composer lint), the static analysis fails with exit code 1.This is because
Laravel\Fortify\Http\Responses\LockoutResponsereferencesIlluminate\Http\Response::HTTP_TOO_MANY_REQUESTS, which is undefined inIlluminate\Http\Response's class definition without Larastan's helper mappings.Steps To Reproduce
1.xbranch.composer install.composer lint(which triggersphpstan analyse).Actual Behavior
The analysis fails with the following output:
Proposed Solution
We can replace the undefined constant
Response::HTTP_TOO_MANY_REQUESTSwith the direct HTTP status code429(which represents "Too Many Requests"). This resolves the PHPStan class constant resolution error and allowscomposer lintto pass successfully: