8000 bug #38226 [FrameworkBundle] loadRoutes shoud receive RoutingPhpFileL… · symfony/symfony@2384f08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2384f08

Browse files
committed
bug #38226 [FrameworkBundle] loadRoutes shoud receive RoutingPhpFileLoader (grachevko)
This PR was merged into the 5.1 branch. Discussion ---------- [FrameworkBundle] loadRoutes shoud receive RoutingPhpFileLoader | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> In case when `sensio_framework_extra.router.annotations` options is set to `true` or not defined will throw this error > In RoutingConfigurator.php line 28: > > Argument 2 passed to Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator::__construct() must be an instance of Symfony\Component\Routing\Loader\PhpFileLoader, instance of Symfony\Component\Routing\Loader\AnnotationFileLoader given, called in /opt/app/vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php on line 176 Commits ------- 25a1131 loadRoutes shoud receive RoutingPhpFileLoader
2 parents 4d1a522 + 25a1131 commit 2384f08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function loadRoutes(LoaderInterface $loader)
152152
{
153153
$file = (new \ReflectionObject($this))->getFileName();
154154
/* @var RoutingPhpFileLoader $kernelLoader */
155-
$kernelLoader = $loader->getResolver()->resolve($file);
155+
$kernelLoader = $loader->getResolver()->resolve($file, 'php');
156156
$kernelLoader->setCurrentDir(\dirname($file));
157157
$collection = new RouteCollection();
158158

0 commit comments

Comments
 (0)
0