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 db0bc17 commit 8d79d8c6739b31962dbb22616656c6016e661300
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 8d79d8c

Please sign in to comment.
You can’t perform that action at this time.