Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Add new Types for non-empty-string and positive-int #11748

Open
ThomasLandauer opened this issue Dec 4, 2024 · 0 comments
Open

Comments

@ThomasLandauer
Copy link
Contributor

Feature Request

What

Implement something like Types:NON_EMPTY_STRING and Types::POSITIVE_INT.

Why

Since Symfony 7.2, UserInterface::getUserIdentifier() is annotated with @return non-empty-string.

So if you're fetching that user identifier from the database, PHPStan will report something like:

Property App\Entity\User::$... type mapping mismatch: database can contain string but property expects non-empty-string.

So instead of telling everybody to just @phpstan-ignore it (e.g. at phpstan/phpstan-doctrine#204), I'm wondering if it would be possible to fix the root cause :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant