Currently, the components’ persistent parameters are only converted to a type when they have default value:
|
$type = gettype($meta['def']); |
|
if (!$reflection->convertType($params[$name], $type)) { |
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.
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 @persistentIt would need to be extracted here and then handled in the function above.
I can implement this if you agree.