Skip to content

Commit 16c1939

Browse files
committed
minor #15773 [Routing] Use fourth argument of RoutingConfigurator instead of non-existent method (Jeroeny)
This PR was merged into the 4.4 branch. Discussion ---------- [Routing] Use fourth argument of RoutingConfigurator instead of non-existent method `$routeConfigurator->import` returns [ImportConfigurator](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Routing/Loader/Configurator/ImportConfigurator.php), which doesn't seem to have the `exclude` method. Or am I missing something? Commits ------- f86496c Use fourth argument of RoutingConfigurator instead of non-existent method
2 parents 3d89933 + f86496c commit 16c1939

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

routing.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,11 @@ the common configuration using options when importing the routes.
12471247
return function (RoutingConfigurator $routes) {
12481248
// use the optional fourth argument of import() to exclude some files
12491249
// or subdirectories when loading annotations
1250-
$routes->import('../../src/Controller/', 'annotation')
1250+
$routes->import(
1251+
resource: '../../src/Controller/',
1252+
type: 'annotation',
1253+
exclude: '../../src/Controller/{DebugEmailController}.php'
1254+
)
12511255
// this is added to the beginning of all imported route URLs
12521256
->prefix('/blog')
12531257
@@ -1260,9 +1264,6 @@ the common configuration using options when importing the routes.
12601264
12611265
// these requirements are added to all imported routes
12621266
->requirements(['_locale' => 'en|es|fr'])
1263-
1264-
// you can optionally exclude some files/subdirectories when loading annotations
1265-
->exclude('../../src/Controller/{DebugEmailController}.php')
12661267
;
12671268
};
12681269

0 commit comments

Comments
 (0)