Trying to stop not set error...
This commit is contained in:
parent
aaaf644118
commit
451a1c0576
|
|
@ -44,7 +44,6 @@ class Router implements HandlerInterface
|
||||||
*/
|
*/
|
||||||
public function getResponse(RequestInterface $request, array $args = null)
|
public function getResponse(RequestInterface $request, array $args = null)
|
||||||
{
|
{
|
||||||
$response = null;
|
|
||||||
$path = $request->getPath();
|
$path = $request->getPath();
|
||||||
if (array_key_exists($path, $this->routes)) {
|
if (array_key_exists($path, $this->routes)) {
|
||||||
$handler = new $this->routes[$path]();
|
$handler = new $this->routes[$path]();
|
||||||
|
|
@ -65,7 +64,7 @@ class Router implements HandlerInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($response) {
|
if (isset($response) and $response) {
|
||||||
// Check if the router has an error handler for this status code.
|
// Check if the router has an error handler for this status code.
|
||||||
$status = $response->getStatusCode();
|
$status = $response->getStatusCode();
|
||||||
if (array_key_exists($status, $this->errorHandlers)) {
|
if (array_key_exists($status, $this->errorHandlers)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue