Skip to content

PHPStan extension unable to report optional positive-int #480

@XbNz

Description

@XbNz

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.

Metadata

Metadata

Assignees

Labels

Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions