8000 Review fixes · symfony/symfony@cfdc528 · GitHub
[go: up one dir, main page]

Skip to content

Commit cfdc528

Browse files
committed
Review fixes
1 parent a74819e commit cfdc528

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -967,17 +967,6 @@ public function resolveServices($value)
967967
} elseif ($value instanceof IteratorArgument) {
968968
$parameterBag = $this->getParameterBag();
969969

970-
$count = 0;
971-
foreach ($value->getValues() as $k => $v) {
972-
foreach (self::getServiceConditionals($v) as $s) {
973-
if (!$this->has($s)) {
974-
continue 2;
975-
}
976-
}
977-
978-
++$count;
979-
}
980-
981970
$value = new RewindableGenerator(function () use ($value, $parameterBag) {
982971
foreach ($value->getValues() as $k => $v) {
983972
foreach (self::getServiceConditionals($v) as $s) {
@@ -988,7 +977,18 @@ public function resolveServices($value)
988977

989978
yield $k => $this->resolveServices($parameterBag->unescapeValue($parameterBag->resolveValue($v)));
990979
}
991-
}, $count);
980+
}, function () use ($value) {
981+
$count = 0;
982+
foreach ($value->getValues() as $v) {
983+
foreach (self::getServiceConditionals($v) as $s) {
984+
if (!$this->has($s)) {
985+
continue 2;
986+
}
987+
}
988+
989+
++$count;
990+
}
991+
});
992992
} elseif ($value instanceof ClosureProxyArgument) {
993993
$parameterBag = $this->getParameterBag();
994994
list($reference, $method) = $value->getValues();

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,15 +1409,15 @@ private function dumpValue($value, $interpolate = true)
14091409

14101410
$code = array();
14111411
$code[] = 'new RewindableGenerator(function() {';
1412-
foreach ($value->getValues() as $k => $value) {
1413-
$v = $this->wrapServiceConditionals($value, sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $this->dumpValue($value, $interpolate)));
1414-
foreach (explode("\n", $v) as $v) {
1415-
if ($v) {
1416-
$code[] = ' '.$v;
1412+
foreach ($value->getValues() as $k => $v) {
1413+
$y = $this->wrapServiceConditionals($v, sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate)));
1414+
foreach (explode("\n", $y) as $y) {
1415+
if ($y) {
1416+
$code[] = ' '.$y;
14171417
}
14181418
}
14191419

1420-
($c = $this->getServiceConditionals($value)) ? $operands[] = "(int) ($c)" : ++$operands[0];
1420+
($c = $this->getServiceConditionals($v)) ? $operands[] = "(int) ($c)" : ++$operands[0];
14211421
}
14221422

14231423
$countCode[] = sprintf(' return %s;', implode(' + ', $operands));

0 commit comments

Comments
 (0)
0