Refactor Request::getRequestTarget to get PHPUnit to provide accurate coverage.
This commit is contained in:
parent
d696727cb1
commit
7cb6304037
|
|
@ -110,18 +110,17 @@ class Request extends Message implements RequestInterface
|
|||
public function getRequestTarget()
|
||||
{
|
||||
if (isset($this->requestTarget)) {
|
||||
$target = $this->requestTarget;
|
||||
return $this->requestTarget;
|
||||
} elseif (isset($this->uri)) {
|
||||
$target = $this->uri->getPath();
|
||||
$query = $this->uri->getQuery();
|
||||
if ($query) {
|
||||
$target .= "?" . $query;
|
||||
}
|
||||
} else {
|
||||
$target = "/";
|
||||
}
|
||||
return $target;
|
||||
}
|
||||
return "/";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance with a specific request-target.
|
||||
|
|
|
|||
Loading…
Reference in New Issue