Skip to content

Commit d612d53

Browse files
committed
Merge branch '4.4' into 5.1
2 parents 62f8716 + c77a268 commit d612d53

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

Controller/ControllerResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function createController(string $controller)
114114
return $controller;
115115
}
116116

117-
list($class, $method) = explode('::', $controller, 2);
117+
[$class, $method] = explode('::', $controller, 2);
118118

119119
try {
120120
$controller = [$this->instantiateController($class), $method];
@@ -172,7 +172,7 @@ private function getControllerError($callable): string
172172
return 'Invalid array callable, expected [controller, method].';
173173
}
174174

175-
list($controller, $method) = $callable;
175+
[$controller, $method] = $callable;
176176

177177
if (\is_string($controller) && !class_exists($controller)) {
178178
return sprintf('Class "%s" does not exist.', $controller);

DataCollector/DumpDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function dump(Data $data)
7575
$this->stopwatch->start('dump');
7676
}
7777

78-
list('name' => $name, 'file' => $file, 'line' => $line, 'file_excerpt' => $fileExcerpt) = $this->sourceContextProvider->getContext();
78+
['name' => $name, 'file' => $file, 'line' => $line, 'file_excerpt' => $fileExcerpt] = $this->sourceContextProvider->getContext();
7979

8080
if ($this->dumper instanceof Connection) {
8181
if (!$this->dumper->write($data)) {

DependencyInjection/RegisterControllerArgumentLocatorsPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function process(ContainerBuilder $container)
106106
if (!isset($methods[$action = strtolower($attributes['action'])])) {
107107
throw new InvalidArgumentException(sprintf('Invalid "action" attribute on tag "%s" for service "%s": no public "%s()" method found on class "%s".', $this->controllerTag, $id, $attributes['action'], $class));
108108
}
109-
list($r, $parameters) = $methods[$action];
109+
[$r, $parameters] = $methods[$action];
110110
$found = false;
111111

112112
foreach ($parameters as $p) {
@@ -124,7 +124,7 @@ public function process(ContainerBuilder $container)
124124
}
125125
}
126126

127-
foreach ($methods as list($r, $parameters)) {
127+
foreach ($methods as [$r, $parameters]) {
128128
/** @var \ReflectionMethod $r */
129129

130130
// create a per-method map of argument-names to service/type-references
@@ -146,7 +146,7 @@ public function process(ContainerBuilder $container)
146146
} elseif (isset($bindings[$bindingName = $type.' $'.$p->name]) || isset($bindings[$bindingName = '$'.$p->name]) || isset($bindings[$bindingName = $type])) {
147147
$binding = $bindings[$bindingName];
148148

149-
list($bindingValue, $bindingId, , $bindingType, $bindingFile) = $binding->getValues();
149+
[$bindingValue, $bindingId, , $bindingType, $bindingFile] = $binding->getValues();
150150
$binding->setValues([$bindingValue, $bindingId, true, $bindingType, $bindingFile]);
151151

152152
if (!$bindingValue instanceof Reference) {

DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function process(ContainerBuilder $container)
4949
}
5050

5151
$controllerDef = $container->getDefinition($id);
52-
foreach ($controllerDef->getMethodCalls() as list($method)) {
52+
foreach ($controllerDef->getMethodCalls() as [$method]) {
5353
if (0 === strcasecmp($action, $method)) {
5454
$reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id);
5555
break;

Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function locateResource(string $name)
245245
$bundleName = substr($name, 1);
246246
$path = '';
247247
if (false !== strpos($bundleName, '/')) {
248-
list($bundleName, $path) = explode('/', $bundleName, 2);
248+
[$bundleName, $path] = explode('/', $bundleName, 2);
249249
}
250250

251251
$bundle = $this->getBundle($bundleName);

Profiler/FileProfilerStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function find(?string $ip, ?string $url, ?int $limit, ?string $method, in
6161
$result = [];
6262
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
6363
$values = str_getcsv($line);
64-
list($csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode) = $values;
64+
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
6565
$csvTime = (int) $csvTime;
6666

6767
if ($ip && false === strpos($csvIp, $ip) || $url && false === strpos($csvUrl, $url) || $method && false === strpos($csvMethod, $method) || $statusCode && false === strpos($csvStatusCode, $statusCode)) {

Tests/DependencyInjection/ControllerArgumentValueResolverPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testServicesAreOrderedAccordingToPriority()
3939
$container = new ContainerBuilder();
4040
$container->setDefinition('argument_resolver', $definition);
4141

42-
foreach ($services as $id => list($tag)) {
42+
foreach ($services as $id => [$tag]) {
4343
$container->register($id)->addTag('controller.argument_value_resolver', $tag);
4444
}
4545

@@ -72,7 +72,7 @@ public function testInDebugWithStopWatchDefinition()
7272
$container->register('debug.stopwatch', Stopwatch::class);
7373
$container->setDefinition('argument_resolver', $definition);
7474

75-
foreach ($services as $id => list($tag)) {
75+
foreach ($services as $id => [$tag]) {
7676
$container->register($id)->addTag('controller.argument_value_resolver', $tag);
7777
}
7878

Tests/HttpCache/StoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function testSetsTheXContentDigestResponseHeaderBeforeStoring()
9292
{
9393
$cacheKey = $this->storeSimpleEntry();
9494
$entries = $this->getStoreMetadata($cacheKey);
95-
list(, $res) = $entries[0];
95+
[, $res] = $entries[0];
9696

9797
$this->assertEquals('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', $res['x-content-digest'][0]);
9898
}
@@ -103,7 +103,7 @@ public function testDoesNotTrustXContentDigestFromUpstream()
103103

104104
$cacheKey = $this->store->write($this->request, $response);
105105
$entries = $this->getStoreMetadata($cacheKey);
106-
list(, $res) = $entries[0];
106+
[, $res] = $entries[0];
107107

108108
$this->assertEquals('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', $res['x-content-digest'][0]);
109109
$this->assertEquals('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', $response->headers->get('X-Content-Digest'));

Tests/HttpCache/TestHttpKernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public function assert(\Closure $callback)
4343
{
4444
$trustedConfig = [Request::getTrustedProxies(), Request::getTrustedHeaderSet()];
4545

46-
list($trustedProxies, $trustedHeaderSet, $backendRequest) = $this->backendRequest;
46+
[$trustedProxies, $trustedHeaderSet, $backendRequest] = $this->backendRequest;
4747
Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
4848

4949
try {
5050
$callback($backendRequest);
5151
} finally {
52-
list($trustedProxies, $trustedHeaderSet) = $trustedConfig;
52+
[$trustedProxies, $trustedHeaderSet] = $trustedConfig;
5353
Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
5454
}
5555
}

0 commit comments

Comments
 (0)