diff --git a/src/DI/Extension.php b/src/DI/Extension.php index b4b56dd..e7b1cdb 100644 --- a/src/DI/Extension.php +++ b/src/DI/Extension.php @@ -184,11 +184,11 @@ protected function createApplication(ContainerBuilder $builder) ->setAutowired(NetteApplicationHandler::class) ->addSetup('$catchExceptions', [$this->config->catchExceptions]) ->addSetup('$errorPresenter', [$this->config->errorPresenter]) - ->addSetup('$onResponse[] = ?', [ - (string)(new Nette\PhpGenerator\Literal( - 'function() { Nette\Http\Helpers::initCookie($this->getService(?), $this->getService(?));};', - [$this->prefix('response'), $this->prefix('request')] - )) + ->addSetup('$onResponse[]', [ + new Nette\PhpGenerator\Literal( + 'function(): void { Nette\Http\Helpers::initCookie($this->getService(?), $this->getService(?));}', + [$this->prefix('request'), $this->prefix('response')] + ) ]); }