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
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 :-)
The text was updated successfully, but these errors were encountered:
The root cause is not with Doctrine, as it does not take any responsibility for content validation whatsoever. As correctly pointed out in the linked issue you can always break it by directly editing the database anyway.
The true root cause is setting an entity field to non-empty-string. Your validation layers should ensure it does not get invalid content, not Doctrine or PHPStan.
Feature Request
What
Implement something like
Types:NON_EMPTY_STRING
andTypes::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:
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 :-)The text was updated successfully, but these errors were encountered: