-
Notifications
You must be signed in to change notification settings - Fork 105
Type entity property as numeric-string
while database column type is string
#187
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
Comments
VerbosityLevel here ( phpstan-doctrine/src/Rules/Doctrine/ORM/EntityColumnRule.php Lines 147 to 165 in d9429f6
typeOnly , but instead obtained via getRecommendedLevelByType .
|
I'll create a PR to fix that. |
I improved the error message in #188. But I still wonder how I can let it pass. I want to type the property as |
What's PHPStan telling you here is that Doctrine can inject a non-numeric string into your entity. You really need a custom mapping type to make sure that doesn't happen. Thank you for the PR! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have an entity with the following column definition:
Now I want to type that property as
numeric-string
because it will only ever contain numbers anyway.But I'm getting this error:
I don't know how to solve this. Is it even possible?
And is the error message correct? Shouldn't it say:
The text was updated successfully, but these errors were encountered: