File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
src/Symfony/Bundle/FrameworkBundle/Command Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -48,26 +48,25 @@ protected function listBundles(OutputInterface $output)
48
48
49
49
protected function findExtension ($ name )
50
50
{
51
- $ extension = null ;
52
51
$ bundles = $ this ->initializeBundles ();
53
52
foreach ($ bundles as $ bundle ) {
54
- $ extension = $ bundle ->getContainerExtension ();
53
+ if ($ name === $ bundle ->getName ()) {
54
+ return $ bundle ->getContainerExtension ();
55
+ }
55
56
56
- if ($ extension && ($ name === $ extension ->getAlias () || $ name === $ bundle ->getName ())) {
57
- break ;
57
+ $ extension = $ bundle ->getContainerExtension ();
58
+ if ($ extension && $ name === $ extension ->getAlias ()) {
59
+ return $ extension ;
58
60
}
59
61
}
60
62
61
- if (!$ extension ) {
63
+ if ('Bundle ' !== substr ($ name , -6 )) {
64
+ $ message = sprintf ('No extensions with configuration available for "%s" ' , $ name );
65
+ } else {
62
66
$ message = sprintf ('No extension with alias "%s" is enabled ' , $ name );
63
- if (preg_match ('/Bundle$/ ' , $ name )) {
64
- $ message = sprintf ('No extensions with configuration available for "%s" ' , $ name );
65
- }
66
-
67
- throw new \LogicException ($ message );
68
67
}
69
68
70
- return $ extension ;
69
+ throw new \ LogicException ( $ message ) ;
71
70
}
72
71
73
72
public function validateConfiguration (ExtensionInterface $ extension , $ configuration )
You can’t perform that action at this time.
0 commit comments