We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Say you have these 2 configs:
$config1 = [ 'di' => [ 'services' => [ 'db' => [ MySQLDB::class, 'arguments' => [ 'username', 'password', 'hostname', ], ], ], ], ];
$config2 = [ 'di' => [ 'services' => [ 'db' => [ FileDB::class, 'arguments' => [ 'filename', ], ], ], ], ];
When loading the configs like so:
Configurator::apply() ->configFromArray($config1) ->configFromArray($config2) ->to($container);
You end up with a config definition like this:
$config2 = [ 'di' => [ 'services' => [ 'db' => [ FileDB::class, 'arguments' => [ 'filename', // from $config2 'password', // from $config1 'hostname', // from $config1 ], ], ], ], ];
Sometimes this is desired behaviour, sometimes it is not. I'm trying to decide if this is a problem and how it should be addressed.
Basically, claim that this isn't a problem and replacing services in this way is not the intended use case.
For example:
$config2 = [ 'di' => [ 'services' => [ 'db' => Configurator::replace([ FileDB::class, 'arguments' => [ 'filename', ], ]), ], ], ];
It's a decent idea but it won't work for non-PHP config files.
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
No branches or pull requests
Say you have these 2 configs:
When loading the configs like so:
You end up with a config definition like this:
Sometimes this is desired behaviour, sometimes it is not. I'm trying to decide if this is a problem and how it should be addressed.
Current options:
1. Treat the config as additive only?
Basically, claim that this isn't a problem and replacing services in this way is not the intended use case.
2. Add method to wrap specific sections
For example:
It's a decent idea but it won't work for non-PHP config files.
The text was updated successfully, but these errors were encountered: