Skip to content

Fix defaultValue type hints #15

@mpscholten

Description

@mpscholten

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions