@@ -83,7 +83,7 @@ public function getCompiledRoutes(bool $forDump = false): array
83
83
$ routes = $ this ->getRoutes ();
84
84
}
85
85
86
- list ( $ staticRoutes , $ dynamicRoutes) = $ this ->groupStaticRoutes ($ routes );
86
+ [ $ staticRoutes , $ dynamicRoutes] = $ this ->groupStaticRoutes ($ routes );
87
87
88
88
$ conditions = [null ];
89
89
$ compiledRoutes [] = $ this ->compileStaticRoutes ($ staticRoutes , $ conditions );
@@ -131,7 +131,7 @@ static function (\$condition, \$context, \$request) { // \$checkCondition
131
131
132
132
private function generateCompiledRoutes (): string
133
133
{
134
- list ( $ matchHost , $ staticRoutes , $ regexpCode , $ dynamicRoutes , $ checkConditionCode) = $ this ->getCompiledRoutes (true );
134
+ [ $ matchHost , $ staticRoutes , $ regexpCode , $ dynamicRoutes , $ checkConditionCode] = $ this ->getCompiledRoutes (true );
135
135
136
136
$ code = self ::export ($ matchHost ).', // $matchHost ' ."\n" ;
137
137
@@ -186,7 +186,7 @@ private function groupStaticRoutes(RouteCollection $collection): array
186
186
if ($ hasTrailingSlash ) {
187
187
$ url = substr ($ url , 0 , -1 );
188
188
}
189
- foreach ($ dynamicRegex as list ( $ hostRx , $ rx , $ prefix) ) {
189
+ foreach ($ dynamicRegex as [ $ hostRx , $ rx , $ prefix] ) {
190
190
if (('' === $ prefix || 0 === strpos ($ url , $ prefix )) && (preg_match ($ rx , $ url ) || preg_match ($ rx , $ url .'/ ' )) && (!$ host || !$ hostRx || preg_match ($ hostRx , $ host ))) {
191
191
$ dynamicRegex [] = [$ hostRegex , $ regex , $ staticPrefix ];
192
192
$ dynamicRoutes ->add ($ name , $ route );
@@ -221,7 +221,7 @@ private function compileStaticRoutes(array $staticRoutes, array &$conditions): a
221
221
222
222
foreach ($ staticRoutes as $ url => $ routes ) {
223
223
$ compiledRoutes [$ url ] = [];
224
- foreach ($ routes as $ name => list ( $ route , $ hasTrailingSlash) ) {
224
+ foreach ($ routes as $ name => [ $ route , $ hasTrailingSlash] ) {
225
225
$ compiledRoutes [$ url ][] = $ this ->compileRoute ($ route , $ name , (!$ route ->compile ()->getHostVariables () ? $ route ->getHost () : $ route ->compile ()->getHostRegex ()) ?: null , $ hasTrailingSlash , false , $ conditions );
226
226
}
227
227
}
@@ -287,7 +287,7 @@ private function compileDynamicRoutes(RouteCollection $collection, bool $matchHo
287
287
$ routes ->add ($ name , $ route );
288
288
}
289
289
290
- foreach ($ perModifiers as list ( $ modifiers , $ routes) ) {
290
+ foreach ($ perModifiers as [ $ modifiers , $ routes] ) {
291
291
$ prev = false ;
292
292
$ perHost = [];
293
293
foreach ($ routes ->all () as $ name => $ route ) {
@@ -306,7 +306,7 @@ private function compileDynamicRoutes(RouteCollection $collection, bool $matchHo
306
306
$ state ->mark += \strlen ($ rx );
307
307
$ state ->regex = $ rx ;
308
308
309
- foreach ($ perHost as list ( $ hostRegex , $ routes) ) {
309
+ foreach ($ perHost as [ $ hostRegex , $ routes] ) {
310
310
if ($ matchHost ) {
311
311
if ($ hostRegex ) {
312
312
preg_match ('#^.\^(.*)\$.[a-zA-Z]*$# ' , $ hostRegex , $ rx );
@@ -391,7 +391,7 @@ private function compileStaticPrefixCollection(StaticPrefixCollection $tree, \st
391
391
continue ;
392
392
}
393
393
394
- list ( $ name , $ regex , $ vars , $ route , $ hasTrailingSlash , $ hasTrailingVar) = $ route ;
394
+ [ $ name , $ regex , $ vars , $ route , $ hasTrailingSlash , $ hasTrailingVar] = $ route ;
395
395
$ compiledRoute = $ route ->compile ();
396
396
$ vars = array_merge ($ state ->hostVars , $ vars );
397
397
0 commit comments