Currently when having something along:
$a = $this->param(...)->string()->defaultsTo(null);
The type of $a as shown in an IDE is string due to the type hints on the defaultsTo method.
We should find a way to have IDEs show the correct type on defaultsTo (which is generic, as the return value of defaultsTo depends on the type of the default value. The type is actually a -> a, but currently we type hint a -> String).
Maybe we can use this: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata
Currently when having something along:
The type of
$aas shown in an IDE isstringdue to the type hints on thedefaultsTomethod.We should find a way to have IDEs show the correct type on
defaultsTo(which is generic, as the return value ofdefaultsTodepends on the type of the default value. The type is actuallya -> a, but currently we type hinta -> String).Maybe we can use this: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata