application
application copied to clipboard
#[Parameter]: throw if not set without default value
- new feature
- BC break? yes
- doc PR: n/a
I have this property:
#[Parameter]
public string $code;
If there's no ?code= in URL and I access $this->code then PHP dies with this fatal error:
Typed property Presenter::$code must not be accessed before initialization
I would prefer to behave it the same way as if there's a missing parameter with render(int $code) which is to throw InvalidArgumentException.