Skip to content

Commit efdbeef

Browse files
Merge branch '2.7' into 2.8
* 2.7: Revert "bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)" [DependencyInjection] inline conditional statements.
2 parents d5e353f + d2c2c05 commit efdbeef

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

Dumper/PhpDumper.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,11 +1029,7 @@ private function addMethodMap()
10291029
private function addAliases()
10301030
{
10311031
if (!$aliases = $this->container->getAliases()) {
1032-
if ($this->container->isFrozen()) {
1033-
return "\n \$this->aliases = array();\n";
1034-
} else {
1035-
return '';
1036-
}
1032+
return $this->container->isFrozen() ? "\n \$this->aliases = array();\n" : '';
10371033
}
10381034

10391035
$code = " \$this->aliases = array(\n";
@@ -1402,9 +1398,9 @@ private function dumpValue($value, $interpolate = true)
14021398
$service = $this->dumpValue($value->getFactoryService(false));
14031399

14041400
return sprintf('%s->%s(%s)', 0 === strpos($service, '$') ? sprintf('$this->get(%s)', $service) : $this->getServiceCall($value->getFactoryService(false)), $value->getFactoryMethod(false), implode(', ', $arguments));
1405-
} else {
1406-
throw new RuntimeException('Cannot dump definitions which have factory method without factory service or factory class.');
14071401
}
1402+
1403+
throw new RuntimeException('Cannot dump definitions which have factory method without factory service or factory class.');
14081404
}
14091405

14101406
$class = $value->getClass();
@@ -1442,9 +1438,9 @@ private function dumpValue($value, $interpolate = true)
14421438
}
14431439
} elseif (is_object($value) || is_resource($value)) {
14441440
throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
1445-
} else {
1446-
return $this->export($value);
14471441
}
1442+
1443+
return $this->export($value);
14481444
}
14491445

14501446
/**
@@ -1513,13 +1509,13 @@ private function getServiceCall($id, Reference $reference = null)
15131509

15141510
if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) {
15151511
return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id);
1516-
} else {
1517-
if ($this->container->hasAlias($id)) {
1518-
$id = (string) $this->container->getAlias($id);
1519-
}
1512+
}
15201513

1521-
return sprintf('$this->get(\'%s\')', $id);
1514+
if ($this->container->hasAlias($id)) {
1515+
$id = (string) $this->container->getAlias($id);
15221516
}
1517+
1518+
return sprintf('$this->get(\'%s\')', $id);
15231519
}
15241520

15251521
/**

0 commit comments

Comments
 (0)