Skip to content

Commit

Permalink
Refactoring default request and response
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianluca Arbezzano committed Sep 28, 2015
1 parent 8569b20 commit 78c6c5d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 78c6c5d

Please sign in to comment.