File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed 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)
4848
4949 protected function findExtension ($ name )
5050 {
51- $ extension = null ;
5251 $ bundles = $ this ->initializeBundles ();
5352 foreach ($ bundles as $ bundle ) {
54- $ extension = $ bundle ->getContainerExtension ();
53+ if ($ name === $ bundle ->getName ()) {
54+ return $ bundle ->getContainerExtension ();
55+ }
5556
56- if ($ extension && ($ name === $ extension ->getAlias () || $ name === $ bundle ->getName ())) {
57- break ;
57+ $ extension = $ bundle ->getContainerExtension ();
58+ if ($ extension && $ name === $ extension ->getAlias ()) {
59+ return $ extension ;
5860 }
5961 }
6062
61- if (!$ extension ) {
63+ if ('Bundle ' !== substr ($ name , -6 )) {
64+ $ message = sprintf ('No extensions with configuration available for "%s" ' , $ name );
65+ } else {
6266 $ 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 );
6867 }
6968
70- return $ extension ;
69+ throw new \ LogicException ( $ message ) ;
7170 }
7271
7372 public function validateConfiguration (ExtensionInterface $ extension , $ configuration )
You can’t perform that action at this time.
0 commit comments