Since version Yii2 v. 2.0.36 the base controller class have these directives inside the init method:
public function init()
{
parent::init();
$this->request = Instance::ensure($this->request, Request::className());
$this->response = Instance::ensure($this->response, Response::className());
}
So any code in downstream classes that call parent::init() before their own installation will receive an error. This means the following init logic no longer works:
$request = OAuth2\Request::createFromGlobals();
Yii2 is also not PSR compliant so these is not possible:
Since version Yii2 v. 2.0.36 the base controller class have these directives inside the init method:
So any code in downstream classes that call parent::init() before their own installation will receive an error. This means the following init logic no longer works:
Yii2 is also not PSR compliant so these is not possible:
Is there anything I can do? I can avoid the error by not calling parent::init() in the child classes but this is something of anti-pattern.