@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $data = $this->params()->fromQuery(); |
| 84 | 84 | $route = null; |
| 85 | - if (isset($data['method']) && !empty($data['method']) && isset($data['url']) && !empty($data['url'])) { |
|
| 86 | - if (null !== ($routeName = $this->routeMatcher->match($data['method'], $data['url']))) { |
|
| 85 | + if (isset($data[ 'method' ]) && !empty($data[ 'method' ]) && isset($data[ 'url' ]) && !empty($data[ 'url' ])) { |
|
| 86 | + if (null !== ($routeName = $this->routeMatcher->match($data[ 'method' ], $data[ 'url' ]))) { |
|
| 87 | 87 | $route = $this->routeCollection->getRoute($routeName); |
| 88 | 88 | $route = [ |
| 89 | 89 | 'name' => $route->getName(), |
@@ -94,6 +94,6 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - return new JsonModel(['requestedRouteData' => $data, 'routeMatch' => $route]); |
|
| 97 | + return new JsonModel([ 'requestedRouteData' => $data, 'routeMatch' => $route ]); |
|
| 98 | 98 | } |
| 99 | 99 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @param array $routes |
| 22 | 22 | */ |
| 23 | - public function __construct(array $routes = []) |
|
| 23 | + public function __construct(array $routes = [ ]) |
|
| 24 | 24 | { |
| 25 | 25 | $this->routes = $routes; |
| 26 | 26 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function addRoute(Route $route) |
| 32 | 32 | { |
| 33 | - $this->routes[$route->getName()] = $route; |
|
| 33 | + $this->routes[ $route->getName() ] = $route; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function getRoute($routeName) |
| 42 | 42 | { |
| 43 | - if (!isset($this->routes[$routeName])) { |
|
| 43 | + if (!isset($this->routes[ $routeName ])) { |
|
| 44 | 44 | return null; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - return $this->routes[$routeName]; |
|
| 47 | + return $this->routes[ $routeName ]; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |