Skip to content

Commit bf08199

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: (31 commits) [Serializer] Remove useless calls to `func_get_arg()` fix tests using Twig 3.12 skip tests requiring the intl extension if it's not installed 🐛 throw ParseException on invalid date [FrameworkBundle] Re-remove redundant name attribute from `default_context` fix permitted data type of the default choice [ExpressionLanguage] Improve test coverage Fix invalid phpdoc in ContainerBuilder [HttpKernel] [WebProfileBundle] Fix Routing panel for URLs with a colon [Form] NumberType: Fix parsing of numbers in exponential notation with negative exponent Fix importing PHP config in prepend extension method [Messenger] Prevent waiting time to overflow when using long delays [Security] consistent singular/plural translation in Dutch reset the validation context after validating nested constraints do not duplicate directory separators fix handling empty data in ValueToDuplicatesTransformer fix compatibility with redis extension 6.0.3+ synchronize unsupported scheme tests [String] Fixed Quorum plural, that was inflected to be only "Quora" and never "Quorums" Fix symfony/kaz-info-teh-notifier package ...
2 parents 8e24a38 + e226093 commit bf08199

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
117117
private array $vendors;
118118

119119
/**
120-
* @var string[] the list of paths in vendor directories
120+
* @var array<string, bool> the cache for paths being in vendor directories
121121
*/
122122
private array $pathsInVendor = [];
123123

Loader/FileLoader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function import(mixed $resource, ?string $type = null, bool|string $ignor
9292
}
9393
} finally {
9494
--$this->importing;
95+
$this->loadExtensionConfigs();
9596
}
9697

9798
return null;

Loader/PhpFileLoader.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ private function executeCallback(callable $callback, ContainerConfigurator $cont
166166
// Force load ContainerConfigurator to make env(), param() etc available.
167167
class_exists(ContainerConfigurator::class);
168168

169-
$callback(...$arguments);
169+
++$this->importing;
170+
try {
171+
$callback(...$arguments);
172+
} finally {
173+
--$this->importing;
174+
}
170175

171176
foreach ($configBuilders as $configBuilder) {
172177
$this->loadExtensionConfig($configBuilder->getExtensionAlias(), ContainerConfigurator::processValue($configBuilder->toArray()));

Tests/Loader/PhpFileLoaderTest.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testLoad()
4848
$this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a PHP file resource');
4949
}
5050

51-
public function testPrependExtensionConfig()
51+
public function testPrependExtensionConfigWithLoadMethod()
5252
{
5353
$container = new ContainerBuilder();
5454
$container->registerExtension(new \AcmeExtension());
@@ -64,6 +64,22 @@ public function testPrependExtensionConfig()
6464
$this->assertSame($expected, $container->getExtensionConfig('acme'));
6565
}
6666

67+
public function testPrependExtensionConfigWithImportMethod()
68+
{
69+
$container = new ContainerBuilder();
70+
$container->registerExtension(new \AcmeExtension());
71+
$container->prependExtensionConfig('acme', ['foo' => 'bar']);
72+
$loader = new PhpFileLoader($container, new FileLocator(\dirname(__DIR__).'/Fixtures'), 'prod', new ConfigBuilderGenerator(sys_get_temp_dir()), true);
73+
$loader->import('config/config_builder.php');
74+
75+
$expected = [
76+
['color' => 'red'],
77+
['color' => 'blue'],
78+
['foo' => 'bar'],
79+
];
80+
$this->assertSame($expected, $container->getExtensionConfig('acme'));
81+
}
82+
6783
public function testConfigServices()
6884
{
6985
$fixtures = realpath(__DIR__.'/../Fixtures');

0 commit comments

Comments
 (0)