Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0163178

Browse filesBrowse files
committed
changed the BundleInterface::buildContainer() signature
1 parent fb4bd35 commit 0163178
Copy full SHA for 0163178

File tree

Expand file treeCollapse file tree

13 files changed

+78
-58
lines changed
Filter options
Expand file treeCollapse file tree

13 files changed

+78
-58
lines changed

‎src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bundle\DoctrineBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6-
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Loader\Loader;
88
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
99
use Symfony\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
@@ -30,18 +30,18 @@ class DoctrineBundle extends Bundle
3030
/**
3131
* Customizes the Container instance.
3232
*
33-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
33+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3434
*
35-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
35+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3636
*/
37-
public function buildContainer(ContainerInterface $container)
37+
public function buildContainer(ParameterBagInterface $parameterBag)
3838
{
39-
Loader::registerExtension(new DoctrineExtension($container->getParameter('kernel.bundle_dirs'), $container->getParameter('kernel.bundles')));
39+
Loader::registerExtension(new DoctrineExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
4040

4141
$metadataDirs = array();
4242
$entityDirs = array();
43-
$bundleDirs = $container->getParameter('kernel.bundle_dirs');
44-
foreach ($container->getParameter('kernel.bundles') as $className) {
43+
$bundleDirs = $parameterBag->get('kernel.bundle_dirs');
44+
foreach ($parameterBag->get('kernel.bundles') as $className) {
4545
$tmp = dirname(str_replace('\\', '/', $className));
4646
$namespace = str_replace('/', '\\', dirname($tmp));
4747
$class = basename($tmp);
@@ -55,7 +55,7 @@ public function buildContainer(ContainerInterface $container)
5555
}
5656
}
5757
}
58-
$container->setParameter('doctrine.orm.metadata_driver.mapping_dirs', $metadataDirs);
59-
$container->setParameter('doctrine.orm.entity_dirs', $entityDirs);
58+
$parameterBag->set('doctrine.orm.metadata_driver.mapping_dirs', $metadataDirs);
59+
$parameterBag->set('doctrine.orm.entity_dirs', $entityDirs);
6060
}
61-
}
61+
}

‎src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bundle\DoctrineMongoDBBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6-
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Loader\Loader;
88
use Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection\MongoDBExtension;
99

@@ -16,8 +16,15 @@
1616
*/
1717
class DoctrineMongoDBBundle extends Bundle
1818
{
19-
public function buildContainer(ContainerInterface $container)
19+
/**
20+
* Customizes the Container instance.
21+
*
22+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
23+
*
24+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
25+
*/
26+
public function buildContainer(ParameterBagInterface $parameterBag)
2027
{
21-
Loader::registerExtension(new MongoDBExtension($container->getParameter('kernel.bundles')));
28+
Loader::registerExtension(new MongoDBExtension($parameterBag->get('kernel.bundles')));
2229
}
2330
}

‎src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bundle\FrameworkBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6-
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Loader\Loader;
88
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
99
use Symfony\Components\DependencyInjection\BuilderConfiguration;
@@ -30,22 +30,22 @@ class FrameworkBundle extends Bundle
3030
/**
3131
* Customizes the Container instance.
3232
*
33-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
33+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3434
*
35-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
35+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3636
*/
37-
public function buildContainer(ContainerInterface $container)
37+
public function buildContainer(ParameterBagInterface $parameterBag)
3838
{
39-
Loader::registerExtension(new WebExtension($container->getParameter('kernel.bundle_dirs'), $container->getParameter('kernel.bundles')));
39+
Loader::registerExtension(new WebExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
4040

4141
$dirs = array('%kernel.root_dir%/views/%%bundle%%/%%controller%%/%%name%%%%format%%.%%renderer%%');
42-
foreach ($container->getParameter('kernel.bundle_dirs') as $dir) {
42+
foreach ($parameterBag->get('kernel.bundle_dirs') as $dir) {
4343
$dirs[] = $dir.'/%%bundle%%/Resources/views/%%controller%%/%%name%%%%format%%.%%renderer%%';
4444
}
45-
$container->setParameter('templating.loader.filesystem.path', $dirs);
45+
$parameterBag->set('templating.loader.filesystem.path', $dirs);
4646

4747
$configuration = new BuilderConfiguration();
48-
if ($container->getParameter('kernel.debug')) {
48+
if ($parameterBag->get('kernel.debug')) {
4949
$loader = new XmlFileLoader(__DIR__.'/Resources/config');
5050
$configuration->merge($loader->load('debug.xml'));
5151
}

‎src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Symfony\Framework\Bundle\Bundle;
66
use Symfony\Components\DependencyInjection\ContainerInterface;
7+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
78

89
class {{ bundle }} extends Bundle
910
{

‎src/Symfony/Bundle/PropelBundle/PropelBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/PropelBundle/PropelBundle.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
namespace Symfony\Bundle\PropelBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
67
use Symfony\Components\DependencyInjection\ContainerInterface;
78
use Symfony\Components\DependencyInjection\Loader\Loader;
89
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
910
use Symfony\Bundle\PropelBundle\DependencyInjection\PropelExtension;
1011

1112
class PropelBundle extends Bundle
1213
{
13-
public function buildContainer(ContainerInterface $container)
14+
/**
15+
* Customizes the Container instance.
16+
*
17+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
18+
*
19+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
20+
*/
21+
public function buildContainer(ParameterBagInterface $parameterBag)
1422
{
1523
Loader::registerExtension(new PropelExtension());
1624
}

‎src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bundle\SwiftmailerBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6-
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Loader\Loader;
88
use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension;
99

@@ -28,11 +28,11 @@ class SwiftmailerBundle extends Bundle
2828
/**
2929
* Customizes the Container instance.
3030
*
31-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
31+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3232
*
33-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
33+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3434
*/
35-
public function buildContainer(ContainerInterface $container)
35+
public function buildContainer(ParameterBagInterface $parameterBag)
3636
{
3737
Loader::registerExtension(new SwiftmailerExtension());
3838
}

‎src/Symfony/Bundle/TwigBundle/TwigBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/TwigBundle.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bundle\TwigBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6-
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Loader\Loader;
88
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
99
use Symfony\Components\DependencyInjection\BuilderConfiguration;
@@ -30,11 +30,11 @@ class TwigBundle extends Bundle
3030
/**
3131
* Customizes the Container instance.
3232
*
33-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
33+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3434
*
35-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
35+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3636
*/
37-
public function buildContainer(ContainerInterface $container)
37+
public function buildContainer(ParameterBagInterface $parameterBag)
3838
{
3939
Loader::registerExtension(new TwigExtension());
4040
}

‎src/Symfony/Bundle/ZendBundle/ZendBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/ZendBundle/ZendBundle.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bundle\ZendBundle;
44

55
use Symfony\Framework\Bundle\Bundle;
6-
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Reference;
88
use Symfony\Components\DependencyInjection\Loader\Loader;
99
use Symfony\Bundle\ZendBundle\DependencyInjection\ZendExtension;
@@ -29,11 +29,11 @@ class ZendBundle extends Bundle
2929
/**
3030
* Customizes the Container instance.
3131
*
32-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
32+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3333
*
34-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
34+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3535
*/
36-
public function buildContainer(ContainerInterface $container)
36+
public function buildContainer(ParameterBagInterface $parameterBag)
3737
{
3838
Loader::registerExtension(new ZendExtension());
3939
}

‎src/Symfony/Framework/Bundle/Bundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Framework/Bundle/Bundle.php
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Symfony\Framework\Bundle;
44

55
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
67
use Symfony\Components\Console\Application;
78

89
/*
@@ -31,18 +32,18 @@ abstract class Bundle implements BundleInterface
3132
/**
3233
* Customizes the Container instance.
3334
*
34-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
35+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3536
*
36-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
37+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3738
*/
38-
public function buildContainer(ContainerInterface $container)
39+
public function buildContainer(ParameterBagInterface $parameterBag)
3940
{
4041
}
4142

4243
/**
4344
* Boots the Bundle.
4445
*
45-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
46+
* @param \Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
4647
*/
4748
public function boot(ContainerInterface $container)
4849
{
@@ -51,7 +52,7 @@ public function boot(ContainerInterface $container)
5152
/**
5253
* Shutdowns the Bundle.
5354
*
54-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
55+
* @param \Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
5556
*/
5657
public function shutdown(ContainerInterface $container)
5758
{

‎src/Symfony/Framework/Bundle/BundleInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Framework/Bundle/BundleInterface.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Symfony\Framework\Bundle;
44

55
use Symfony\Components\DependencyInjection\ContainerInterface;
6+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
67

78
/*
89
* This file is part of the Symfony framework.
@@ -25,11 +26,11 @@ interface BundleInterface
2526
/**
2627
* Customizes the Container instance.
2728
*
28-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
29+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
2930
*
30-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
31+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3132
*/
32-
public function buildContainer(ContainerInterface $container);
33+
public function buildContainer(ParameterBagInterface $parameterBag);
3334

3435
/**
3536
* Boots the Bundle.

‎src/Symfony/Framework/Kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Framework/Kernel.php
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,19 @@ protected function needsReload($class, $location)
338338

339339
protected function buildContainer($class, $file)
340340
{
341-
$container = new Builder(new ParameterBag($this->getKernelParameters()));
341+
$parameterBag = new ParameterBag($this->getKernelParameters());
342342

343343
$configuration = new BuilderConfiguration();
344344
foreach ($this->bundles as $bundle) {
345-
$configuration->merge($bundle->buildContainer($container));
345+
$configuration->merge($bundle->buildContainer($parameterBag));
346346

347347
if ($this->debug) {
348348
$configuration->addObjectResource($bundle);
349349
}
350350
}
351351
$configuration->merge($this->registerContainerConfiguration());
352+
353+
$container = new Builder($parameterBag);
352354
$container->merge($configuration);
353355
$container->freeze();
354356

‎src/Symfony/Framework/KernelBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Framework/KernelBundle.php
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Symfony\Framework\Bundle\Bundle;
66
use Symfony\Framework\ClassCollectionLoader;
77
use Symfony\Framework\DependencyInjection\KernelExtension;
8+
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
89
use Symfony\Components\DependencyInjection\ContainerInterface;
910
use Symfony\Components\DependencyInjection\Loader\Loader;
1011
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
@@ -31,11 +32,11 @@ class KernelBundle extends Bundle
3132
/**
3233
* Customizes the Container instance.
3334
*
34-
* @param Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance
35+
* @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
3536
*
36-
* @return Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
37+
* @return \Symfony\Components\DependencyInjection\BuilderConfiguration A BuilderConfiguration instance
3738
*/
38-
public function buildContainer(ContainerInterface $container)
39+
public function buildContainer(ParameterBagInterface $parameterBag)
3940
{
4041
Loader::registerExtension(new KernelExtension());
4142

@@ -44,7 +45,7 @@ public function buildContainer(ContainerInterface $container)
4445
$loader = new XmlFileLoader(array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config'));
4546
$configuration->merge($loader->load('services.xml'));
4647

47-
if ($container->getParameter('kernel.debug')) {
48+
if ($parameterBag->get('kernel.debug')) {
4849
$configuration->merge($loader->load('debug.xml'));
4950
$configuration->setDefinition('event_dispatcher', $configuration->findDefinition('debug.event_dispatcher'));
5051
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.