Skip to content

Commit acd4607

Browse files
committed
minor #11684 [DX] Removed strict alias name check (WouterJ)
This PR was merged into the 2.6-dev branch. Discussion ---------- [DX] Removed strict alias name check Symfony allows to change the DI alias by overriding `Extension#getAlias()`, but it does throw an exception when it is anything else than the default. That doesn't sound nice and it makes it harder to change the alias. This can result in problems when the bundle is called WouterJEloquentBundle for instance (which has a default alias of `wouter_j_eloquent_bundle`, where I want it to be `wouterj_eloquent_bundle`). | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 69d71c1 Made the exception message nicer
2 parents 8053700 + 4fb77c7 commit acd4607

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Bundle/Bundle.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ public function getContainerExtension()
8282
$expectedAlias = Container::underscore($basename);
8383
if ($expectedAlias != $extension->getAlias()) {
8484
throw new \LogicException(sprintf(
85-
'The extension alias for the default extension of a '.
86-
'bundle must be the underscored version of the '.
87-
'bundle name ("%s" instead of "%s")',
85+
'Users will expect the alias of the default extension of a bundle to be the underscored version of the bundle name ("%s"). You can override "Bundle::getContainerExtension()" if you want to use "%s" or another alias.',
8886
$expectedAlias, $extension->getAlias()
8987
));
9088
}

0 commit comments

Comments
 (0)