Skip to content

Commit 6a2c5f4

Browse files
Merge branch '7.4' into 8.0
* 7.4: (28 commits) [Messenger] Allow Pheanstalk v8 [TypeInfo] Fix resolving constructor type with templates fix compatibility with RelayCluster 0.12 fix type alias with template resolving fix compatibility with RelayCluster 0.11 and 0.12 [DependencyInjection] Register a custom autoloader to generate `*Config` classes when they don't exist yet [Security] Add security:oidc-token:generate command [PropertyInfo][TypeInfo] Fix resolving constructor type with templates [WebProfilerBundle] ”finish” errored requests Add support for union types on AsEventListener [Console] Update CHANGELOG to reflect attribute name changes for interactive invokable commands bump ext-redis to 6.2 and ext-relay to 0.12 minimum [TypeInfo] Fix type alias with template resolving [Console] Add support for interactive invokable commands with `#[Interact]` and `#[Ask]` attributes bump ext-relay to 0.12+ fix merge [Config] Generate the array-shape of the current node instead of the whole root node in Config classes [HttpFoundation] Deprecate Request::get() in favor of using properties ->attributes, query or request directly fix Relay Cluster 0.12 compatibility [TypeInfo] ArrayShape can resolve key type as callable instead of string ...
2 parents 08a196e + d1f7528 commit 6a2c5f4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Loader/PhpFileLoader.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
class PhpFileLoader extends FileLoader
3737
{
3838
protected bool $autoRegisterAliasesForSinglyImplementedInterfaces = false;
39+
private ?\Closure $configBuilderAutoloader = null;
3940

4041
public function __construct(
4142
ContainerBuilder $container,
@@ -60,6 +61,14 @@ public function load(mixed $resource, ?string $type = null): mixed
6061
// Force load ContainerConfigurator to make env(), param() etc available.
6162
class_exists(ContainerConfigurator::class);
6263

64+
if ($autoloaderRegistered = !$this->configBuilderAutoloader && $this->generator) {
65+
spl_autoload_register($this->configBuilderAutoloader = function (string $class) {
66+
if (str_starts_with($class, 'Symfony\\Config\\') && str_ends_with($class, 'Config')) {
67+
$this->configBuilder($class);
68+
}
69+
});
70+
}
71+
6372
// the closure forbids access to the private scope in the included file
6473
$load = \Closure::bind(static function ($path, $env) use ($container, $loader, $resource, $type) {
6574
return include $path;
@@ -108,6 +117,11 @@ class_exists(ContainerConfigurator::class);
108117
} finally {
109118
$this->instanceof = [];
110119
$this->registerAliasesForSinglyImplementedInterfaces();
120+
121+
if ($autoloaderRegistered) {
122+
spl_autoload_unregister($this->configBuilderAutoloader);
123+
$this->configBuilderAutoloader = null;
124+
}
111125
}
112126

113127
return null;

0 commit comments

Comments
 (0)