You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Hmm, bit strange that the release notes mention something which doesn't work then (i.e.: linking to PHPStan documentation listing type names which aren't supported).
As a work-a-round I'm now using int<0, max>, which behaves identical / for which non-negative-int is an alias. So it seems a bit odd that one "style" works and the other doesn't.
As a work-a-round I'm now using int<0, max>, which behaves identical / for which non-negative-int is an alias. So it seems a bit odd that one "style" works and the other doesn't.
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:
A
LogicException
is thrown:And the same applies to
non-positive-int
as well.Additional context
No response
The text was updated successfully, but these errors were encountered: