Skip to content

Commit fd33cb2

Browse files
committed
feature #35514 [DI][Routing] add wither to configure the path of PHP-DSL configurators (nicolas-grekas)
This PR was merged into the 5.1-dev branch. Discussion ---------- [DI][Routing] add wither to configure the path of PHP-DSL configurators | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This makes PHP-DSL configurators more flexible, by allowing to use them for a different path than they were initially created for. Sidekick of symfony/recipes#721 Commits ------- 8f92c85689 [DI][Routing] add wither to configure the path of PHP-DSL configurators
2 parents f61eae2 + c8c8d77 commit fd33cb2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Kernel/MicroKernelTrait.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function registerContainerConfiguration(LoaderInterface $loader)
124124
}
125125

126126
// the user has opted into using the ContainerConfigurator
127-
$defaultDefinition = (new Definition())->setAutowired(true)->setAutoconfigured(true);
128127
/* @var ContainerPhpFileLoader $kernelLoader */
129128
$kernelLoader = $loader->getResolver()->resolve($file);
130129
$kernelLoader->setCurrentDir(\dirname($file));
@@ -136,7 +135,7 @@ public function registerContainerConfiguration(LoaderInterface $loader)
136135
};
137136

138137
try {
139-
$this->configureContainer(new ContainerConfigurator($container, $kernelLoader, $instanceof, $file, $file, $defaultDefinition), $loader);
138+
$this->configureContainer(new ContainerConfigurator($container, $kernelLoader, $instanceof, $file, $file), $loader);
140139
} finally {
141140
$instanceof = [];
142141
$kernelLoader->registerAliasesForSinglyImplementedInterfaces();

Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ protected function configureContainer(ContainerConfigurator $c)
7979
$c->services()
8080
->set('logger', NullLogger::class)
8181
->set('stdClass', 'stdClass')
82+
->autowire()
8283
->factory([$this, 'createHalloween'])
8384
->arg('$halloween', '%halloween%');
8485

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"symfony/polyfill-mbstring": "~1.0",
2828
"symfony/filesystem": "^4.4|^5.0",
2929
"symfony/finder": "^4.4|^5.0",
30-
"symfony/routing": "^5.0"
30+
"symfony/routing": "^5.1"
3131
},
3232
"require-dev": {
3333
"doctrine/annotations": "~1.7",

0 commit comments

Comments
 (0)