@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $collection->addRoute($routeMethod, $route['path'], $route['handler'], $route['names']); |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | - } catch (ParseException $e) { |
|
| 71 | + }catch (ParseException $e) { |
|
| 72 | 72 | throw new RouterException($e->getMessage()); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | try { |
| 118 | 118 | $resolvedHandler['controller'] = $this->_findClass($controllerMethod[0]); |
| 119 | - } catch (\Exception $e) { |
|
| 119 | + }catch (\Exception $e) { |
|
| 120 | 120 | throw new DispatchException($e->getMessage()); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | try { |
| 169 | 169 | $this->_getParamsFromVariableName($args); |
| 170 | - } catch (\Exception $e) { |
|
| 170 | + }catch (\Exception $e) { |
|
| 171 | 171 | $this->_getParamsFromTypeHint($args); |
| 172 | 172 | } |
| 173 | 173 | |
@@ -293,12 +293,12 @@ discard block |
||
| 293 | 293 | try { |
| 294 | 294 | $this->_checkWhiteList($controller, $this->options); |
| 295 | 295 | $this->_checkBlackList($controller, $this->options); |
| 296 | - } catch (\Exception $e) { |
|
| 296 | + }catch (\Exception $e) { |
|
| 297 | 297 | unset($controllerObj); |
| 298 | 298 | throw new DispatchException($e->getMessage()); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - if (!method_exists($controllerObj,$method)){ |
|
| 301 | + if (!method_exists($controllerObj, $method)) { |
|
| 302 | 302 | throw new DispatchException('Controller method does not exist'); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $handler = 'my-handler'; |
| 35 | 35 | $routes = $this->collection; |
| 36 | - $routes->group('/path', function () use ($routes, $handler) { |
|
| 36 | + $routes->group('/path', function() use ($routes, $handler) { |
|
| 37 | 37 | $routes->addRoute(['GET', 'POST'], '/foo', $handler, ['global']); |
| 38 | - $routes->group('/sub-dir', function () use ($routes, $handler) { |
|
| 38 | + $routes->group('/sub-dir', function() use ($routes, $handler) { |
|
| 39 | 39 | $routes->addRoute(['GET'], '/sub-page', $handler, ['sub-dir']); |
| 40 | 40 | }); |
| 41 | 41 | }); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | public function testMergeCollection() |
| 176 | 176 | { |
| 177 | 177 | $handler = 'handler::string'; |
| 178 | - $names = ['routes','names']; |
|
| 178 | + $names = ['routes', 'names']; |
|
| 179 | 179 | $collection = new RouteCollection(); |
| 180 | 180 | $collection->addRoute('GET', '/path', $handler, $names); |
| 181 | 181 | $collection->addRoute('GET', '/another', $handler, $names); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | { |
| 195 | 195 | $this->setExpectedException(RouteException::class); |
| 196 | 196 | $handler = 'handler::string'; |
| 197 | - $names = ['routes','names']; |
|
| 197 | + $names = ['routes', 'names']; |
|
| 198 | 198 | $collection = new RouteCollection(); |
| 199 | 199 | $collection->addRoute('GET', '/path', $handler, $names); |
| 200 | 200 | $collection->addRoute('GET', '/another', $handler, $names); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $rawPattern = '/mypattern/'; |
| 241 | 241 | $expectedPattern = '/' . \ltrim($rawPattern, '/'); |
| 242 | 242 | $expected = \implode('', $groups) . $expectedPattern; |
| 243 | - $expected = \rtrim($expected,'/'); |
|
| 243 | + $expected = \rtrim($expected, '/'); |
|
| 244 | 244 | |
| 245 | 245 | $this->assertEquals($expected, $collection->formatRoutePattern($rawPattern)); |
| 246 | 246 | } |
@@ -250,11 +250,11 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function testMergeGroupNames() |
| 252 | 252 | { |
| 253 | - $expected = ['route-name','group-name']; |
|
| 253 | + $expected = ['route-name', 'group-name']; |
|
| 254 | 254 | $handler = 'myhandler'; |
| 255 | 255 | $routes = $this->collection; |
| 256 | 256 | |
| 257 | - $routes->group('/path', function () use ($routes, $handler) { |
|
| 257 | + $routes->group('/path', function() use ($routes, $handler) { |
|
| 258 | 258 | $routes->addRoute(['GET', 'POST'], '/foo', $handler, ['route-name']); |
| 259 | 259 | }, ['group-name']); |
| 260 | 260 | |