-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Typed persistent parameters #230
Comments
Nette only recognize persistent params as typed when they have default value. nette/application#230 Since users are allowed to set various static properties after the construction of VP, we cannot set the default values and need to convert the params manually.
Can you better describe what situation you want to deal with? |
The And indeed, it does convert the type for us when we set a default value. However, that is not always possible. We can assign the default value Setting the type to |
I understand, you just need nullable typed property. I will add them, but I wouldn't probably support the |
Currently, the components’ persistent parameters are only converted to a type when they have default value:
application/src/Application/UI/Component.php
Lines 138 to 139 in 9483f43
Sometimes, the value can only be set dynamically but we would still like for it to be properly converted in
loadState
.I propose recognizing typed annotations like
@var int @persistent
It would need to be extracted here and then handled in the function above.
I can implement this if you agree.
The text was updated successfully, but these errors were encountered: