@@ -75,7 +75,7 @@ class Router
75
75
76
76
/**
77
77
* Router constructor method.
78
- *
78
+ *
79
79
* @param array $params
80
80
*
81
81
* @return void
@@ -105,24 +105,24 @@ function __construct(array $params = [])
105
105
protected function setPaths ($ params )
106
106
{
107
107
if (isset ($ params ['paths ' ]) && $ paths = $ params ['paths ' ]) {
108
- $ this ->paths ['controllers ' ] =
108
+ $ this ->paths ['controllers ' ] =
109
109
isset ($ paths ['controllers ' ])
110
110
? trim ($ paths ['controllers ' ], '/ ' )
111
111
: $ this ->paths ['controllers ' ];
112
112
113
- $ this ->paths ['middlewares ' ] =
113
+ $ this ->paths ['middlewares ' ] =
114
114
isset ($ paths ['middlewares ' ])
115
115
? trim ($ paths ['middlewares ' ], '/ ' )
116
116
: $ this ->paths ['middlewares ' ];
117
117
}
118
118
119
119
if (isset ($ params ['namespaces ' ]) && $ namespaces = $ params ['namespaces ' ]) {
120
- $ this ->namespaces ['controllers ' ] =
120
+ $ this ->namespaces ['controllers ' ] =
121
121
isset ($ namespaces ['controllers ' ])
122
122
? trim ($ namespaces ['controllers ' ], '\\' ) . '\\'
123
123
: '' ;
124
124
125
- $ this ->namespaces ['middlewares ' ] =
125
+ $ this ->namespaces ['middlewares ' ] =
126
126
isset ($ namespaces ['middlewares ' ])
127
127
? trim ($ namespaces ['middlewares ' ], '\\' ) . '\\'
128
128
: '' ;
@@ -197,10 +197,10 @@ public function __call($method, $params)
197
197
* Add new route method one or more http methods.
198
198
*
199
199
* @param string $methods
200
- * @param string $route
200
+ * @param string $route
201
201
* @param array|string|closure $settings
202
202
* @param string|closure $callback
203
- *
203
+ *
204
204
* @return void
205
205
*/
206
206
public function add ($ methods , $ route , $ settings , $ callback = null )
@@ -228,7 +228,7 @@ public function add($methods, $route, $settings, $callback = null)
228
228
*
229
229
* @param string|array $pattern
230
230
* @param null|string $attr
231
- *
231
+ *
232
232
* @return void
233
233
* @throws
234
234
*/
@@ -350,10 +350,10 @@ public function run()
350
350
/**
351
351
* Routes Group
352
352
*
353
- * @param string $name
353
+ * @param string $name
354
354
* @param closure|array $settings
355
355
* @param null|closure $callback
356
- *
356
+ *
357
357
* @return void
358
358
*/
359
359
public function group ($ name , $ settings = null , $ callback = null )
@@ -376,12 +376,12 @@ public function group($name, $settings = null, $callback = null)
376
376
foreach ($ this ->groups as $ key => $ value ) {
377
377
if (is_array ($ value ['before ' ])) {
378
378
foreach ($ value ['before ' ] as $ k => $ v ) {
379
- $ list ['before ' ][] = $ v ;
379
+ $ list ['before ' ][] = $ v ;
380
380
}
381
381
foreach ($ value ['after ' ] as $ k => $ v ) {
382
- $ list ['after ' ][] = $ v ;
382
+ $ list ['after ' ][] = $ v ;
383
383
}
384
- }
384
+ }
385
385
}
386
386
387
387
if (! is_null ($ group ['before ' ])) {
@@ -414,7 +414,7 @@ public function group($name, $settings = null, $callback = null)
414
414
* @param string $route
415
415
* @param string|array $settings
416
416
* @param null|string $controller
417
- *
417
+ *
418
418
* @return void
419
419
* @throws
420
420
*/
@@ -429,7 +429,7 @@ public function controller($route, $settings, $controller = null)
429
429
$ controllerFile = realpath (
430
430
rtrim ($ this ->paths ['controllers ' ], '/ ' ) . '/ ' . $ controller . '.php '
431
431
);
432
-
432
+
433
433
if (! file_exists ($ controllerFile )) {
434
434
return $ this ->exception ($ controller . ' class is not found! ' );
435
435
}
@@ -474,7 +474,7 @@ public function controller($route, $settings, $controller = null)
474
474
* Routes error function. (Closure)
475
475
*
476
476
* @param $callback
477
- *
477
+ *
478
478
* @return void
479
479
*/
480
480
public function error ($ callback )
@@ -486,10 +486,10 @@ public function error($callback)
486
486
* Add new Route and it's settings
487
487
*
488
488
* @param $uri
489
- * @param $method
489
+ * @param $method
490
490
* @param $callback
491
491
* @param $settings
492
- *
492
+ *
493
493
* @return void
494
494
*/
495
495
private function addRoute ($ uri , $ method , $ callback , $ settings )
@@ -523,11 +523,11 @@ private function addRoute($uri, $method, $callback, $settings)
523
523
? $ settings ['name ' ]
524
524
: null
525
525
),
526
- 'before ' => (isset ($ settings ['before ' ])
526
+ 'before ' => (isset ($ settings ['before ' ])
527
527
? $ settings ['before ' ]
528
528
: null
529
529
),
530
- 'after ' => (isset ($ settings ['after ' ])
530
+ 'after ' => (isset ($ settings ['after ' ])
531
531
? $ settings ['after ' ]
532
532
: null
533
533
),
@@ -556,9 +556,9 @@ private function runRouteCommand($command, $params = null)
556
556
/**
557
557
* Detect Routes Middleware; before or after
558
558
*
559
- * @param $middleware
559
+ * @param $middleware
560
560
* @param $type
561
- *
561
+ *
562
562
* @return void
563
563
*/
564
564
public function runRouteMiddleware ($ middleware , $ type )
@@ -621,7 +621,7 @@ public function getRoutes()
621
621
622
622
/**
623
623
* Throw new Exception for Router Error
624
- *
624
+ *
625
625
* @param $message
626
626
*
627
627
* @return RouterException
0 commit comments