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 @@ -45,26 +45,25 @@ protected function listBundles($output)
45
45
46
46
protected function findExtension ($ name )
47
47
{
48
- $ extension = null ;
49
48
$ bundles = $ this ->initializeBundles ();
50
49
foreach ($ bundles as $ bundle ) {
51
- $ extension = $ bundle ->getContainerExtension ();
50
+ if ($ name === $ bundle ->getName ()) {
51
+ return $ bundle ->getContainerExtension ();
52
+ }
52
53
53
- if ($ extension && ($ name === $ extension ->getAlias () || $ name === $ bundle ->getName ())) {
54
- break ;
54
+ $ extension = $ bundle ->getContainerExtension ();
55
+ if ($ extension && $ name === $ extension ->getAlias ()) {
56
+ return $ extension ;
55
57
}
56
58
}
57
59
58
- if (!$ extension ) {
60
+ if ('Bundle ' !== substr ($ name , -6 )) {
61
+ $ message = sprintf ('No extensions with configuration available for "%s" ' , $ name );
62
+ } else {
59
63
$ message = sprintf ('No extension with alias "%s" is enabled ' , $ name );
60
- if (preg_match ('/Bundle$/ ' , $ name )) {
61
- $ message = sprintf ('No extensions with configuration available for "%s" ' , $ name );
62
- }
63
-
64
- throw new \LogicException ($ message );
65
64
}
66
65
67
- return $ extension ;
66
+ throw new \ LogicException ( $ message ) ;
68
67
}
69
68
70
69
public function validateConfiguration (ExtensionInterface $ extension , $ configuration )
You can’t perform that action at this time.
0 commit comments