Skip to content

Commit 0085cbc

Browse files
committed
Merge branch '5.1' into 5.x
2 parents 916d4ab + d859f4a commit 0085cbc

13 files changed

+27
-27
lines changed

Argument/BoundArgument.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public function getValues(): array
5454
public function setValues(array $values)
5555
{
5656
if (5 === \count($values)) {
57-
list($this->value, $this->identifier, $this->used, $this->type, $this->file) = $values;
57+
[$this->value, $this->identifier, $this->used, $this->type, $this->file] = $values;
5858
} else {
59-
list($this->value, $this->identifier, $this->used) = $values;
59+
[$this->value, $this->identifier, $this->used] = $values;
6060
}
6161
}
6262
}

Compiler/AbstractRecursivePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected function getConstructor(Definition $definition, bool $required)
127127
}
128128

129129
if ($factory) {
130-
list($class, $method) = $factory;
130+
[$class, $method] = $factory;
131131
if ($class instanceof Reference) {
132132
$class = $this->container->findDefinition((string) $class)->getClass();
133133
} elseif ($class instanceof Definition) {

Compiler/AutowirePass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function doProcessValue($value, bool $isRoot = false)
126126
$this->methodCalls = $this->autowireCalls($reflectionClass, $isRoot);
127127

128128
if ($constructor) {
129-
list(, $arguments) = array_shift($this->methodCalls);
129+
[, $arguments] = array_shift($this->methodCalls);
130130

131131
if ($arguments !== $value->getArguments()) {
132132
$value->setArguments($arguments);
@@ -152,7 +152,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot):
152152

153153
foreach ($this->methodCalls as $i => $call) {
154154
$this->decoratedMethodIndex = $i;
155-
list($method, $arguments) = $call;
155+
[$method, $arguments] = $call;
156156

157157
if ($method instanceof \ReflectionFunctionAbstract) {
158158
$reflectionMethod = $method;

Compiler/AutowireRequiredMethodsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function processValue($value, bool $isRoot = false)
3838
$alreadyCalledMethods = [];
3939
$withers = [];
4040

41-
foreach ($value->getMethodCalls() as list($method)) {
41+
foreach ($value->getMethodCalls() as [$method]) {
4242
$alreadyCalledMethods[strtolower($method)] = true;
4343
}
4444

Compiler/DecoratorServicePass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public function process(ContainerBuilder $container)
4646
}
4747
$decoratingDefinitions = [];
4848

49-
foreach ($definitions as list($id, $definition)) {
49+
foreach ($definitions as [$id, $definition]) {
5050
$decoratedService = $definition->getDecoratedService();
51-
list($inner, $renamedId) = $decoratedService;
51+
[$inner, $renamedId] = $decoratedService;
5252
$invalidBehavior = $decoratedService[3] ?? ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
5353

5454
$definition->setDecoratedService(null);

Compiler/ResolveBindingsPass.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public function process(ContainerBuilder $container)
4141
try {
4242
parent::process($container);
4343

44-
foreach ($this->unusedBindings as list($key, $serviceId, $bindingType, $file)) {
44+
foreach ($this->unusedBindings as [$key, $serviceId, $bindingType, $file]) {
4545
$argumentType = $argumentName = $message = null;
4646

4747
if (false !== strpos($key, ' ')) {
48-
list($argumentType, $argumentName) = explode(' ', $key, 2);
48+
[$argumentType, $argumentName] = explode(' ', $key, 2);
4949
} elseif ('$' === $key[0]) {
5050
$argumentName = $key;
5151
} else {
@@ -117,7 +117,7 @@ protected function processValue($value, bool $isRoot = false)
117117
$bindingNames = [];
118118

119119
foreach ($bindings as $key => $binding) {
120-
list($bindingValue, $bindingId, $used, $bindingType, $file) = $binding->getValues();
120+
[$bindingValue, $bindingId, $used, $bindingType, $file] = $binding->getValues();
121121
if ($used) {
122122
$this->usedBindings[$bindingId] = true;
123123
unset($this->unusedBindings[$bindingId]);
@@ -156,7 +156,7 @@ protected function processValue($value, bool $isRoot = false)
156156
}
157157

158158
foreach ($calls as $i => $call) {
159-
list($method, $arguments) = $call;
159+
[$method, $arguments] = $call;
160160

161161
if ($method instanceof \ReflectionFunctionAbstract) {
162162
$reflectionMethod = $method;
@@ -210,7 +210,7 @@ protected function processValue($value, bool $isRoot = false)
210210
}
211211

212212
if ($constructor) {
213-
list(, $arguments) = array_pop($calls);
213+
[, $arguments] = array_pop($calls);
214214

215215
if ($arguments !== $value->getArguments()) {
216216
$value->setArguments($arguments);
@@ -229,7 +229,7 @@ protected function processValue($value, bool $isRoot = false)
229229
*/
230230
private function getBindingValue(BoundArgument $binding)
231231
{
232-
list($bindingValue, $bindingId) = $binding->getValues();
232+
[$bindingValue, $bindingId] = $binding->getValues();
233233

234234
$this->usedBindings[$bindingId] = true;
235235
unset($this->unusedBindings[$bindingId]);

Compiler/ResolveNamedArgumentsPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function processValue($value, bool $isRoot = false)
4141
$calls[] = ['__construct', $value->getArguments()];
4242

4343
foreach ($calls as $i => $call) {
44-
list($method, $arguments) = $call;
44+
[$method, $arguments] = $call;
4545
$parameters = null;
4646
$resolvedArguments = [];
4747

@@ -107,7 +107,7 @@ protected function processValue($value, bool $isRoot = false)
107107
}
108108
}
109109

110-
list(, $arguments) = array_pop($calls);
110+
[, $arguments] = array_pop($calls);
111111

112112
if ($arguments !== $value->getArguments()) {
113113
$value->setArguments($arguments);

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ public function removeBindings(string $id)
14551455
{
14561456
if ($this->hasDefinition($id)) {
14571457
foreach ($this->getDefinition($id)->getBindings() as $key => $binding) {
1458-
list(, $bindingId) = $binding->getValues();
1458+
[, $bindingId] = $binding->getValues();
14591459
$this->removedBindingIds[(int) $bindingId] = true;
14601460
}
14611461
}

Dumper/PhpDumper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ private function addServiceInclude(string $cId, Definition $definition): string
597597
}
598598
}
599599

600-
foreach ($this->serviceCalls as $id => list($callCount, $behavior)) {
600+
foreach ($this->serviceCalls as $id => [$callCount, $behavior]) {
601601
if ('service_container' !== $id && $id !== $cId
602602
&& ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE !== $behavior
603603
&& $this->container->has($id)
@@ -950,7 +950,7 @@ private function addInlineReference(string $id, Definition $definition, string $
950950
$targetId = (string) $this->container->getAlias($targetId);
951951
}
952952

953-
list($callCount, $behavior) = $this->serviceCalls[$targetId];
953+
[$callCount, $behavior] = $this->serviceCalls[$targetId];
954954

955955
if ($id === $targetId) {
956956
return $this->addInlineService($id, $definition, $definition);
@@ -1006,7 +1006,7 @@ private function addInlineService(string $id, Definition $definition, Definition
10061006
$code = '';
10071007

10081008
if ($isSimpleInstance = $isRootInstance = null === $inlineDef) {
1009-
foreach ($this->serviceCalls as $targetId => list($callCount, $behavior, $byConstructor)) {
1009+
foreach ($this->serviceCalls as $targetId => [$callCount, $behavior, $byConstructor]) {
10101010
if ($byConstructor && isset($this->circularReferences[$id][$targetId]) && !$this->circularReferences[$id][$targetId]) {
10111011
$code .= $this->addInlineReference($id, $definition, $targetId, $forConstructor);
10121012
}
@@ -1076,7 +1076,7 @@ private function addServices(array &$services = null): string
10761076
}
10771077

10781078
foreach ($definitions as $id => $definition) {
1079-
if (!(list($file, $code) = $services[$id]) || null !== $file) {
1079+
if (!([$file, $code] = $services[$id]) || null !== $file) {
10801080
continue;
10811081
}
10821082
if ($definition->isPublic()) {
@@ -1094,7 +1094,7 @@ private function generateServiceFiles(array $services): iterable
10941094
$definitions = $this->container->getDefinitions();
10951095
ksort($definitions);
10961096
foreach ($definitions as $id => $definition) {
1097-
if ((list($file, $code) = $services[$id]) && null !== $file && ($definition->isPublic() || !$this->isTrivialInstance($definition) || isset($this->locatedIds[$id]))) {
1097+
if (([$file, $code] = $services[$id]) && null !== $file && ($definition->isPublic() || !$this->isTrivialInstance($definition) || isset($this->locatedIds[$id]))) {
10981098
yield $file => [$code, $definition->hasTag($this->hotPathTag) || !$definition->hasTag($this->preloadTags[1]) && !$definition->isDeprecated() && !$definition->hasErrors()];
10991099
}
11001100
}
@@ -1796,7 +1796,7 @@ private function dumpValue($value, bool $interpolate = true): string
17961796
return sprintf('new \%s($this->getService, [%s%s], [%s%s])', ServiceLocator::class, $serviceMap, $serviceMap ? "\n " : '', $serviceTypes, $serviceTypes ? "\n " : '');
17971797
}
17981798
} finally {
1799-
list($this->definitionVariables, $this->referenceVariables) = $scope;
1799+
[$this->definitionVariables, $this->referenceVariables] = $scope;
18001800
}
18011801
} elseif ($value instanceof Definition) {
18021802
if ($value->hasErrors() && $e = $value->getErrors()) {

Dumper/XmlDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private function addService(Definition $definition, ?string $id, \DOMElement $pa
118118
$service->setAttribute('lazy', 'true');
119119
}
120120
if (null !== $decoratedService = $definition->getDecoratedService()) {
121-
list($decorated, $renamedId, $priority) = $decoratedService;
121+
[$decorated, $renamedId, $priority] = $decoratedService;
122122
$service->setAttribute('decorates', $decorated);
123123

124124
$decorationOnInvalid = $decoratedService[3] ?? ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;

0 commit comments

Comments
 (0)