Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan extension unable to report optional positive-int #480

Open
XbNz opened this issue Jun 14, 2024 · 0 comments
Open

PHPStan extension unable to report optional positive-int #480

XbNz opened this issue Jun 14, 2024 · 0 comments
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@XbNz
Copy link

XbNz commented Jun 14, 2024

Describe the bug

Type\optional(Type\positive_int())->coerce(...)

Resulting in the following PHPStan error:

 Parameter #1 $id of class ExampleDto constructor expects int<1, max>|null, int|null given

Environment (please complete the following information):

  • OS: MacOS 14.5 Senoma
  • PHP version 8.2.19
  • Version:
composer show azjezz/psl

name     : azjezz/psl
descrip. : PHP Standard Library
keywords :
versions : * 2.9.1

Additional

I'm using the php-standard-library/phpstan-extension library for loading the PHPStan extension, which doesn't seem to be the issue since everything else is being picked up just fine.

@XbNz XbNz added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

2 participants