Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Removed a no longer used property from request handler
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Mar 30, 2018
1 parent 37730e2 commit e6598cf
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/Middleware/PathMiddlewareDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
// layer.
return $this->middleware->process(
$requestToProcess,
$this->prepareHandlerForOriginalRequest($handler, $request)
$this->prepareHandlerForOriginalRequest($handler)
);
}

Expand Down Expand Up @@ -97,27 +97,18 @@ private function getTruncatedPath(string $segment, string $path) : string
return substr($path, strlen($segment));
}

private function prepareHandlerForOriginalRequest(
RequestHandlerInterface $handler,
ServerRequestInterface $originalRequest
) : RequestHandlerInterface {
return new class ($handler, $originalRequest, $this->prefix) implements RequestHandlerInterface {
private function prepareHandlerForOriginalRequest(RequestHandlerInterface $handler) : RequestHandlerInterface
{
return new class ($handler, $this->prefix) implements RequestHandlerInterface {
/** @var RequestHandlerInterface */
private $handler;

/** @var ServerRequestInterface */
private $originalRequest;

/** @var string */
private $prefix;

public function __construct(
RequestHandlerInterface $handler,
ServerRequestInterface $originalRequest,
string $prefix
) {
public function __construct(RequestHandlerInterface $handler, string $prefix)
{
$this->handler = $handler;
$this->originalRequest = $originalRequest;
$this->prefix = $prefix;
}

Expand Down

0 comments on commit e6598cf

Please sign in to comment.