Skip to content

Commit 6769c4c

Browse files
bug #62402 [FrameworkBundle] Revert auto-import of #[Route] defined on controllers (nicolas-grekas)
This PR was merged into the 7.4 branch. Discussion ---------- [FrameworkBundle] Revert auto-import of #[Route] defined on controllers | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #62401 | License | MIT Something we did in #62302 but that leads to #62401 Commits ------- fd44c2e [FrameworkBundle] Revert auto-import of #[Route] defined on controllers
2 parents f92b1d2 + fd44c2e commit 6769c4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ private function configureRoutes(RoutingConfigurator $routes): void
7979
$routes->import($configDir.'/{routes}/'.$this->environment.'/*.{php,yaml}');
8080
$routes->import($configDir.'/{routes}/*.{php,yaml}');
8181

82-
$routes->import('routing.controllers');
83-
8482
if (is_file($this->getConfigDir().'/routes.yaml')) {
8583
$routes->import($configDir.'/routes.yaml');
8684
} else {
8785
$routes->import($configDir.'/{routes}.php');
8886
}
87+
88+
if ($fileName = (new \ReflectionObject($this))->getFileName()) {
89+
$routes->import($fileName, 'attribute');
90+
}
8991
}
9092

9193
/**

0 commit comments

Comments
 (0)