Skip to content

Commit

Permalink
handle request in init
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoulgrave committed Feb 2, 2018
1 parent e36879f commit d0dfa25
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Bear/Routing/SymfonyRoutingAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public function __construct(LoaderInterface $loader, $resource)
$this->loader = $loader;
$this->resource = $resource;
$this->request = Request::createFromGlobals();
$context = new RequestContext();
$context->fromRequest($this->request);
$this->router = new Router($this->loader, $this->resource, [], $context);
}

/**
Expand Down Expand Up @@ -78,7 +75,9 @@ public function resolve(string $uri, string $method): RoutingResolution
*/
public function init(): void
{
return;
$context = new RequestContext();
$context->fromRequest($this->request);
$this->router = new Router($this->loader, $this->resource, [], $context);
}

/**
Expand Down

0 comments on commit d0dfa25

Please sign in to comment.