Skip to content

Commit 491c122

Browse files
committed
feature #35560 [HttpKernel] allow using public aliases to reference controllers (nicolas-grekas)
This PR was merged into the 5.1-dev branch. Discussion ---------- [HttpKernel] allow using public aliases to reference controllers | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This PR allows referencing a controller with an alias when needed. The use case I'm targetting is using `@Route` annotations on methods of the `App\Kernel` and have them work. This PR allows it. Sidekick of symfony/recipes#735 Commits ------- 94bc1f7d3b [HttpKernel] allow using public aliases to reference controllers
2 parents d5825b4 + 5a2f695 commit 491c122

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kernel/MicroKernelTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function registerContainerConfiguration(LoaderInterface $loader)
141141
AbstractConfigurator::$valuePreProcessor = $valuePreProcessor;
142142
}
143143

144-
$container->setAlias(static::class, 'kernel');
144+
$container->setAlias(static::class, 'kernel')->setPublic(true);
145145
});
146146
}
147147

0 commit comments

Comments
 (0)