Skip to content

[Bug]: Not all integer range types supported #2252

Open
@RobertMe

Description

@RobertMe

Version

4.25.0

Description

The release notes of 4.24.0 mention that integer range types are now supported, and links to PHPStans documentation for an explanation. But it seems like non-negative-int, which is on that list, isn't supported?

When I use:

        /**
         * @var non-negative-int
         */
        #[Assert\Range(min: 0)]
        #[Property(
            description: '...',
        )]
        public readonly int $pageNumber = 0;

A LogicException is thrown:

Schema of type "\<my namespace>\non-negative-int" can't be generated, no describer supports it. Class "\<my namespace>\non-negative-int" does not exist, did you forget a use statement, or typed it wrong?

And the same applies to non-positive-int as well.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions