Closed as not planned
Description
Symfony version(s) affected
7.3.0
Description
When running composer update symfony/*
to upgrade from 7.2 to 7.3, all packages are downloaded and installed. When composer tries to clear the Symfony cache and the container is rebuilt, the following error is thrown:

Line 799 contains:
return $container->privates['App\\Infrastructure\\ValueObject\\Measurement\\UnitSystem'] = [NULL, 'from']($container->get("app.config")->get("appearance.unit_system", ));
The error is thrown due to the first value in the array NULL
. The reason for NULL being there is that my service is defined as:
App\Infrastructure\ValueObject\Measurement\UnitSystem:
factory: [ null, from ]
arguments: ['@=app_config("appearance.unit_system")']
How to reproduce
- Add an entry in
services.yaml
with a factory method on the class itself:
App\Namespace\To\Class
factory: [ null, yourFactoryMethod ]
arguments: ['your-argument']
- update
composer.json
and edit all Symfony packages from7.2.*
to7.3.*
- Run
composer update symfony/*
Possible Solution
No response
Additional Context
The Symfony docs state that this approach should be possible: https://symfony.com/doc/current/service_container/factories.html#using-the-class-as-factory-itself