8000 [HttpKernel] allowed bundle names to have 'bundle' in their base name · beenalee/symfony@77f9daf · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 77f9daf

Browse files
committed
[HttpKernel] allowed bundle names to have 'bundle' in their base name
1 parent 40d256e commit 77f9daf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Component/HttpKernel/Bundle/Bundle.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ public function build(ContainerBuilder $container)
6565
public function getContainerExtension()
6666
{
6767
if (null === $this->extension) {
68-
$class = $this->getNamespace().'\\DependencyInjection\\'.str_replace('Bundle', 'Extension', $this->getName());
68+
$basename = preg_replace('/Bundle$/', '', $this->getName());
69+
70+
$class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
6971
if (class_exists($class)) {
7072
$extension = new $class();
7173

7274
// check naming convention
73-
$expectedAlias = Container::underscore(str_replace('Bundle', '', $this->getName()));
75+
$expectedAlias = Container::underscore($basename);
7476
if ($expectedAlias != $extension->getAlias()) {
7577
throw new \LogicException(sprintf(
7678
'The extension alias for the default extension of a '.

0 commit comments

Comments
 (0)
0