diff --git a/src/App.php b/src/App.php index ed9c09b..36d84ac 100644 --- a/src/App.php +++ b/src/App.php @@ -47,9 +47,6 @@ public function __construct($router = null, ContainerInterface $container = null $this->container = $container ?: static::buildContainer(Loader::load()); $container = &$this->container; - $this->response = new Response(); - $this->request = ServerRequestFactory::fromGlobals(); - if ($router == null && $container->has('router') == false) { throw new Exception('Define router config'); } @@ -128,8 +125,8 @@ private function getEventManager() */ public function run($request = null, $response = null) { - ($request != null) ?: $request = $this->request; - ($response != null) ?: $response = $this->response; + ($request != null) ?: $request = ServerRequestFactory::fromGlobals(); + ($response != null) ?: $response = new Response(); $event = new HttpFlowEvent('bootstrap', $request, $response); $container = $this->getContainer();