File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,12 @@ public function build(ContainerBuilder $container)
72
72
public function getContainerExtension ()
73
73
{
74
74
if (null === $ this ->extension ) {
75
- $ basename = preg_replace ('/Bundle$/ ' , '' , $ this ->getName ());
76
-
77
- $ class = $ this ->getNamespace ().'\\DependencyInjection \\' .$ basename .'Extension ' ;
75
+ $ class = $ this ->getContainerExtensionClass ();
78
76
if (class_exists ($ class )) {
79
77
$ extension = new $ class ();
80
78
81
79
// check naming convention
80
+ $ basename = preg_replace ('/Bundle$/ ' , '' , $ this ->getName ());
82
81
$ expectedAlias = Container::underscore ($ basename );
83
82
if ($ expectedAlias != $ extension ->getAlias ()) {
84
83
throw new \LogicException (sprintf (
@@ -197,4 +196,16 @@ public function registerCommands(Application $application)
197
196
}
198
197
}
199
198
}
199
+
200
+ /**
201
+ * Returns the bundle's container extension class.
202
+ *
203
+ * @return string
204
+ */
205
+ protected function getContainerExtensionClass ()
206
+ {
207
+ $ basename = preg_replace ('/Bundle$/ ' , '' , $ this ->getName ());
208
+
209
+ return $ this ->getNamespace ().'\\DependencyInjection \\' .$ basename .'Extension ' ;
210
+ }
200
211
}
You can’t perform that action at this time.
0 commit comments