@@ -42,7 +42,7 @@ class ChainRouter implements ChainRouterInterface, WarmableInterface
42
42
*
43
43
* @var array
44
44
*/
45
- private $ routers = array () ;
45
+ private $ routers = [] ;
46
46
47
47
/**
48
48
* @var RouterInterface[] Array of routers, sorted by priority
@@ -86,11 +86,11 @@ public function add($router, $priority = 0)
86
86
throw new \InvalidArgumentException (sprintf ('%s is not a valid router. ' , get_class ($ router )));
87
87
}
88
88
if (empty ($ this ->routers [$ priority ])) {
89
- $ this ->routers [$ priority ] = array () ;
89
+ $ this ->routers [$ priority ] = [] ;
90
90
}
91
91
92
92
$ this ->routers [$ priority ][] = $ router ;
93
- $ this ->sortedRouters = array () ;
93
+ $ this ->sortedRouters = [] ;
94
94
}
95
95
96
96
/**
@@ -127,7 +127,7 @@ protected function sortRouters()
127
127
krsort ($ this ->routers );
128
128
129
129
if (0 === count ($ this ->routers )) {
130
- return array () ;
130
+ return [] ;
131
131
}
132
132
133
133
return call_user_func_array ('array_merge ' , $ this ->routers );
@@ -212,9 +212,9 @@ private function doMatch($pathinfo, Request $request = null)
212
212
* Loops through all registered routers and returns a router if one is found.
213
213
* It will always return the first route generated.
214
214
*/
215
- public function generate ($ name , $ parameters = array () , $ absolute = UrlGeneratorInterface::ABSOLUTE_PATH )
215
+ public function generate ($ name , $ parameters = [] , $ absolute = UrlGeneratorInterface::ABSOLUTE_PATH )
216
216
{
217
- $ debug = array () ;
217
+ $ debug = [] ;
218
218
219
219
foreach ($ this ->all () as $ router ) {
220
220
// if $router does not announce it is capable of handling
@@ -266,7 +266,7 @@ private function rebuildRequest($pathinfo)
266
266
267
267
$ uri = $ pathinfo ;
268
268
269
- $ server = array () ;
269
+ $ server = [] ;
270
270
if ($ this ->context ->getBaseUrl ()) {
271
271
$ uri = $ this ->context ->getBaseUrl ().$ pathinfo ;
272
272
$ server ['SCRIPT_FILENAME ' ] = $ this ->context ->getBaseUrl ();
@@ -281,7 +281,7 @@ private function rebuildRequest($pathinfo)
281
281
}
282
282
$ uri = $ this ->context ->getScheme ().':// ' .$ host .$ uri .'? ' .$ this ->context ->getQueryString ();
283
283
284
- return Request::create ($ uri , $ this ->context ->getMethod (), $ this ->context ->getParameters (), array (), array () , $ server );
284
+ return Request::create ($ uri , $ this ->context ->getMethod (), $ this ->context ->getParameters (), [], [] , $ server );
285
285
}
286
286
287
287
private function getErrorMessage ($ name , $ router = null , $ parameters = null )
0 commit comments