Skip to content

PHPStan extension unable to report optional positive-int #33

Description

@XbNz

Describe the bug

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

Resulting in the following PHPStan error:

 Parameter php-standard-library/php-standard-library#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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions