Skip to content

Commit 887061a

Browse files
Reduce common control flows
1 parent 0a0eb06 commit 887061a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,16 +1139,15 @@ private function addNewInstance(Definition $definition, string $return = '', ?st
11391139
{
11401140
$tail = $return ? str_repeat(')', substr_count($return, '(') - substr_count($return, ')')).";\n" : '';
11411141

1142+
$arguments = [];
11421143
if (BaseServiceLocator::class === $definition->getClass() && $definition->hasTag($this->serviceLocatorTag)) {
1143-
$arguments = [];
11441144
foreach ($definition->getArgument(0) as $k => $argument) {
11451145
$arguments[$k] = $argument->getValues()[0];
11461146
}
11471147

11481148
return $return.$this->dumpValue(new ServiceLocatorArgument($arguments)).$tail;
11491149
}
11501150

1151-
$arguments = [];
11521151
foreach ($definition->getArguments() as $i => $value) {
11531152
$arguments[] = (\is_string($i) ? $i.': ' : '').$this->dumpValue($value);
11541153
}

0 commit comments

Comments
 (0)