-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
A clear and concise description of what the bug is.
Passing an integer variable as the first or third argument to the helper function retry results in an error.
psalm
=====
ERROR: ArgumentTypeCoercion
at ...
Argument 1 of retry expects int<1, max>|list<int>, but parent type int provided (see https://psalm.dev/193)
$retries,
ERROR: ArgumentTypeCoercion
at ...
Argument 3 of retry expects int<0, max>, but parent type int provided (see https://psalm.dev/193)
$retrySleep,In the Laravel framework itself, the types are only declared as integers.
In my opinion the error reported by the stub is a false-positive, because if one of these arguments doesn't match the type of the stub, it won't cause an error.
$timesas less than 1 would still execute$callback$sleepas less than 0 would still result in a sleep of 0 ms
Impacted Versions
Please paste the output of composer show | grep -E 'psalm|laravel' so we can see what versions are impacted
barryvdh/laravel-ide-helper 3.6.0 Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
laravel/framework 11.46.1 The Laravel Framework.
laravel/horizon 5.40.0 Dashboard and code-driven configuration for Laravel queues.
laravel/octane 2.13.1 Supercharge your Laravel application's performance.
laravel/prompts 0.3.7 Add beautiful and user-friendly forms to your command-line applications.
laravel/serializable-closure 2.0.6 Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
laravel/tinker 2.10.1 Powerful REPL for the Laravel framework.
spatie/laravel-data 3.12.0 Create unified resources and data transfer objects
spatie/laravel-package-tools 1.92.7 Tools for creating Laravel packagesbarryvdh/laravel-ide-helper 3.5.5 Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
laravel/prompts 0.3.7 Add beautiful and user-friendly forms to your command-line applications.
laravel/serializable-closure 2.0.6 Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
psalm/plugin-laravel 3.0.4 Psalm plugin for Laravel
vimeo/psalm 6.13.1 A static analysis tool for finding errors in PHP applicationsAdditional context
Add any other context about the problem here.
retryfunction signature of Laravel 12.x https://github.com/laravel/framework/blob/23c789521ce3b40374c770011d6f371ff1e6b779/src/Illuminate/Support/helpers.php#L299-L312retryfunction signature of Laravel 11.x https://github.com/laravel/framework/blob/3b3c9f986bac11d20cdf02efe5c061ecabb3527e/src/Illuminate/Support/helpers.php#L307-L321
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working