Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b1ad92

Browse files
committed
Adding concrete implementations so that both methods don't *have* to be implemented
1 parent 5467231 commit 1b1ad92

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/Symfony/Component/HttpKernel/MicroKernel.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@
2424
*/
2525
abstract class MicroKernel extends Kernel
2626
{
27+
/**
28+
* Applies the bundle configuration and calls configureServices() for continued building.
29+
*
30+
* @param LoaderInterface $loader
31+
*/
32+
public function registerContainerConfiguration(LoaderInterface $loader)
33+
{
34+
if (!$loader instanceof ContainerBuilderAwareLoader) {
35+
throw new \LogicException('registerContainerConfiguration requires the LoaderInterface to be a ContainerBuilderAwareLoader.');
36+
}
37+
38+
$this->configureExtensions($loader->getContainerBuilder(), $loader->getResourceLoader());
39+
$this->configureServices($loader->getContainerBuilder(), $loader->getResourceLoader());
40+
}
41+
2742
/**
2843
* Configure dependency injection extensions that have been added to the container.
2944
*
@@ -34,29 +49,18 @@ abstract class MicroKernel extends Kernel
3449
* @param ContainerBuilder $c
3550
* @param LoaderInterface $loader
3651
*/
37-
abstract protected function configureExtensions(ContainerBuilder $c, LoaderInterface $loader);
52+
protected function configureExtensions(ContainerBuilder $c, LoaderInterface $loader)
53+
{
54+
}
3855

3956
/**
4057
* Add any service definitions to your container.
4158
*
4259
* @param ContainerBuilder $c
4360
* @param LoaderInterface $loader
4461
*/
45-
abstract protected function configureServices(ContainerBuilder $c, LoaderInterface $loader);
46-
47-
/**
48-
* Applies the bundle configuration and calls configureServices() for continued building.
49-
*
50-
* @param LoaderInterface $loader
51-
*/
52-
public function registerContainerConfiguration(LoaderInterface $loader)
62+
protected function configureServices(ContainerBuilder $c, LoaderInterface $loader)
5363
{
54-
if (!$loader instanceof ContainerBuilderAwareLoader) {
55-
throw new \LogicException('registerContainerConfiguration requires the LoaderInterface to be a ContainerBuilderAwareLoader.');
56-
}
57-
58-
$this->configureExtensions($loader->getContainerBuilder(), $loader->getResourceLoader());
59-
$this->configureServices($loader->getContainerBuilder(), $loader->getResourceLoader());
6064
}
6165

6266
/**

0 commit comments

Comments
 (0)