Skip to content
Permalink
Browse files

Processor: definition of 'type' will not overide 'factory' of parent …

…service (BC break) (#39)
  • Loading branch information...
dg committed Mar 13, 2019
1 parent 368865f commit fafd328d755c055788102cab8f84dbb5b7cf10e2
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/DI/Config/Processor.php
@@ -195,22 +195,18 @@ private function updateServiceDefinition(Definitions\ServiceDefinition $definiti
{
$config = self::processArguments($config);
if (array_key_exists('type', $config) || array_key_exists('factory', $config)) {
if (array_key_exists('factory', $config)) {
$definition->setFactory($config['factory']);
$definition->setType(null);
$definition->setFactory(null);
}
if (array_key_exists('type', $config)) {
if ($config['type'] instanceof Statement) {
trigger_error("Service '$name': option 'type' or 'class' should be changed to 'factory'.", E_USER_DEPRECATED);
$definition->setFactory($config['type']);
} else {
$definition->setType($config['type']);
}
$definition->setFactory($config['type']);
}
if (array_key_exists('factory', $config)) {
$definition->setFactory($config['factory']);
}
if (array_key_exists('arguments', $config)) {

0 comments on commit fafd328

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.