Problem/Motivation
Over in #3161889: [META] Symfony 6 compatibility we have discovered that Symfony has tightened up the definition of a value in a ParameterBag:
public function set(string $name, array|bool|string|int|float|null $value) {
$this->parameters[$name] = $value;
}
ie. the value cannot be an object.
The only place we rely on this in core is a single test case that checks that our container dumper correctly stores service references as container parameters:
[
['reference' => new Reference('referenced_service')],
['reference' => $this->getServiceCall('referenced_service')],
TRUE,
],
getServiceCall()
returns an object, which can no longer be stored in a Symfony 6 ParameterBag.
Symfony's PHP dumper does not support service references as parameters; https://github.com/symfony/dependency-injection/blob/6c566c7b29e36daa806...
Steps to reproduce
Proposed resolution
Drop support for service references as parameters.
Remaining tasks
Decide if we need a deprecation notice for this.
Decide whether to throw an explicit exception or just let it fail.
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#4 | 3262853-4.patch | 2.08 KB | longwave |
|
Comments
Comment #2
longwaveComment #3
longwaveComment #4
longwavePlease credit @daffie for part of this patch, taken from #3161889: [META] Symfony 6 compatibility.
Comment #5
daffie CreditAttribution: daffie commentedLooks good to me.
Comment #7
catchCommitted 8b09bcf and pushed to 10.0.x. Thanks!
Comment #8
xjmShould this have a CR?
Comment #9
catch@xjm this ones OK, we were trying to support something that would never work in practice. The test coverage asserts that things are dumped, but not that you can actually do this in a functioning way.