-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Entity property with unknown type is ignored #521
Comments
The question is what is the proper fix. I'd rather refrain from depending on some phodoc parser able to handle this 🤔 |
I would say phpstan/phpdoc-parser is reasonable dependency. But not supporting it and just informing by throwing exception might be good enough too. |
I would say there are three tasks:
The validation is rather too complicated and I would refrain from doing so 🤔 Supporting just the parsing could be nicely and easily done without an dependency. I do not expect any other more complex types like functional types and so. |
With the increased amount of what types can be (newly union types in PHP 8.1), we should use PHPStans phpdoc parser. The question is how the validation should work. Probably full validation should be implemented. |
"Full" validation actually means just:
|
What will be the behavior for not supported types? Throw exception or note in documentation type may not be true? Exception is safer but it will likely lead to requests for types users actually do use. |
Either:
/shrug |
"Entity property with unknown type is ignored" is not ignored anymore after #680. If the type is too complex, it throws an exception during metadata parsing. What remains is the better runtime validation or the |
But removing from 5.0 milestone as the second part will happen later. |
Describe the bug
Properties using generic array syntax and defining key type are ignored.
To Reproduce
Nextras\Orm\Entity\Entity
)@property array<string, string> $example
$example
property,EntityMetadata
should throw exceptionExpected behavior
@property array<string, string> $example
is a valid property, same as (currently valid)@property array<string> $example
or at least throw an exception describing syntax is not supported.Versions::
The text was updated successfully, but these errors were encountered: