[DependencyInjection] Fix service() as invokable factory in array-based PHP config#64311
[DependencyInjection] Fix service() as invokable factory in array-based PHP config#64311nicolas-grekas merged 1 commit intosymfony:7.4symfony/symfony:7.4from nicolas-grekas:fix-php-array-config-service-factorynicolas-grekas/symfony:fix-php-array-config-service-factoryCopy head branch name to clipboard
service() as invokable factory in array-based PHP config#64311Conversation
…ased PHP config `ContainerConfigurator::processValue()` turns `ReferenceConfigurator` instances into `Reference` objects when forwarding array-based PHP config to `YamlFileLoader::parseCallable()`, which only accepted strings and arrays as input and threw on a bare `Reference`. Since `Reference` is already part of `parseCallable()`'s return type and mirrors the post-processed form of `'@id'` strings, accept it as input and treat it as an invokable, like the `'@id'` branch does.
|
Do you think The real issue originates in |
|
YamlLoader is not only for yaml anymore with the php config format. We refactored it in 8.1 for this reason, but the code remains. |
ContainerConfigurator::processValue()turnsReferenceConfiguratorinstances intoReferenceobjects when forwarding array-based PHP config toYamlFileLoader::parseCallable(), which only accepted strings and arrays as input and threw on a bareReference. SinceReferenceis already part ofparseCallable()'s return type and mirrors the post-processed form of'@id'strings, accept it as input and treat it as an invokable, like the'@id'branch does.