Version: 3.1.2
Bug Description
When using non-nullable typed property marked as @persistent Error Typed property must not be accessed before initialization is thrown
This can be fixed by using nullable public ?int $id = null but I think that clearly marking variable as required for presenter is better for code readability.
Error occurs here:
|
$params[$name] = $this->$name; |
Steps To Reproduce
class SomePresenter extends Presenter {
/** @persistent */
public int $id;
public function actionSomething()
{
}
}
Possible Solution
Throw something like BadRequestException Missing parameter $id required by SomePresenter for typed properties
or
Do not throw error and skip all unitialized (or null) persistent values just by isset check
Version: 3.1.2
Bug Description
When using non-nullable typed property marked as
@persistentErrorTyped property must not be accessed before initializationis thrownThis can be fixed by using nullable
public ?int $id = nullbut I think that clearly marking variable as required for presenter is better for code readability.Error occurs here:
application/src/Application/UI/Component.php
Line 164 in 1ed2d0a
Steps To Reproduce
Possible Solution
Throw something like BadRequestException
Missing parameter $id required by SomePresenterfor typed propertiesor
Do not throw error and skip all unitialized (or null) persistent values just by isset check