psl icon indicating copy to clipboard operation
psl copied to clipboard

PHPStan extension unable to report optional positive-int

Open XbNz opened this issue 1 year ago • 0 comments

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 avatar Jun 14 '24 02:06 XbNz