From ba02d24f34bee997a455098fd43f83dc54cdfccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20=C5=A0trop?= Date: Tue, 18 Apr 2023 20:56:32 +0200 Subject: [PATCH] fix(Extension): fix init cookie on response setup --- src/DI/Extension.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DI/Extension.php b/src/DI/Extension.php index b4b56dd..a6415da 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('$service->onResponse[] = ?', [ + new Nette\PhpGenerator\Literal( + 'function() { Nette\Http\Helpers::initCookie($this->getService(?), $this->getService(?));}', + [$this->prefix('request'), $this->prefix('response')] + ) ]); }