Skip to content

Commit 1a3a913

Browse files
committed
Use short array deconstruction syntax.
1 parent 827a008 commit 1a3a913

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

BinaryFileResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function prepare(Request $request)
220220
// @link https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-redirect
221221
$parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping', ''), ',=');
222222
foreach ($parts as $part) {
223-
list($pathPrefix, $location) = $part;
223+
[$pathPrefix, $location] = $part;
224224
if (substr($path, 0, \strlen($pathPrefix)) === $pathPrefix) {
225225
$path = $location.substr($path, \strlen($pathPrefix));
226226
// Only set X-Accel-Redirect header if a valid URI can be produced
@@ -240,7 +240,7 @@ public function prepare(Request $request)
240240
$range = $request->headers->get('Range');
241241

242242
if (0 === strpos($range, 'bytes=')) {
243-
list($start, $end) = explode('-', substr($range, 6), 2) + [0];
243+
[$start, $end] = explode('-', substr($range, 6), 2) + [0];
244244

245245
$end = ('' === $end) ? $fileSize - 1 : (int) $end;
246246

IpUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function checkIp4($requestIp, $ip)
7373
}
7474

7575
if (false !== strpos($ip, '/')) {
76-
list($address, $netmask) = explode('/', $ip, 2);
76+
[$address, $netmask] = explode('/', $ip, 2);
7777

7878
if ('0' === $netmask) {
7979
return self::$checkedIps[$cacheKey] = filter_var($address, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4);
@@ -121,7 +121,7 @@ public static function checkIp6($requestIp, $ip)
121121
}
122122

123123
if (false !== strpos($ip, '/')) {
124-
list($address, $netmask) = explode('/', $ip, 2);
124+
[$address, $netmask] = explode('/', $ip, 2);
125125

126126
if ('0' === $netmask) {
127127
return (bool) unpack('n*', @inet_pton($address));

ServerBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getHeaders()
6666
// Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic
6767
$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2);
6868
if (2 == \count($exploded)) {
69-
list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
69+
[$headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']] = $exploded;
7070
}
7171
} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) {
7272
// In some circumstances PHP_AUTH_DIGEST needs to be set

0 commit comments

Comments
 (0)