This code is correct and working. With phpstan >= 1.10.23 it reports error Access to an uninitialized property App\AdminModule\Presenters\AdminPresenter::$user.
class AdminPresenter extends Presenter
{
/** @inject */
public User $user;
public function startup()
{
parent::startup();
if (!$this->user->isLoggedIn()) {
// do something
}
}
}
This code is correct and working. With phpstan >= 1.10.23 it reports error
Access to an uninitialized property App\AdminModule\Presenters\AdminPresenter::$user.