mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
List syntax (#529)
List (array destructuring) assignment should be declared using the configured syntax.
This commit is contained in:
6
cal.php
6
cal.php
@@ -353,13 +353,13 @@ function read_event($fp)
|
||||
if (count($linearr) < 13) { return false; }
|
||||
|
||||
// Get components
|
||||
list(
|
||||
[
|
||||
$day, $month, $year, $country,
|
||||
$sdesc, $id, $ldesc, $url, $recur, $tipo, $sdato, $edato, $category
|
||||
) = $linearr;
|
||||
] = $linearr;
|
||||
|
||||
// Get info on recurring event
|
||||
@list($recur, $recur_day) = explode(":", $recur, 2);
|
||||
@[$recur, $recur_day] = explode(":", $recur, 2);
|
||||
|
||||
// Return with SQL-resultset like array
|
||||
return [
|
||||
|
||||
@@ -107,7 +107,7 @@ foreach ($active_branches as $major => $releases) {
|
||||
krsort($releases);
|
||||
foreach ((array)$releases as $release) {
|
||||
$version = $release['version'];
|
||||
list($major, $minor, $_) = explode('.', $version);
|
||||
[$major, $minor, $_] = explode('.', $version);
|
||||
$intro .= "
|
||||
<li class='hero-version'><a class='hero-version-link' href='/downloads.php#v$version'>$version</a> · <a class='notes' href='/ChangeLog-$major.php#$version'>Changelog</a> · <a class='notes' href='/migration$major$minor'>Upgrading</a></li>\n";
|
||||
}
|
||||
|
||||
2
mod.php
2
mod.php
@@ -27,7 +27,7 @@ ERROR;
|
||||
$sites = ["php.net", "lists.php.net"];
|
||||
|
||||
// Get data from the URL
|
||||
list($none, $site, $token, $sender) = explode("/", $_SERVER["PATH_INFO"]);
|
||||
[$none, $site, $token, $sender] = explode("/", $_SERVER["PATH_INFO"]);
|
||||
|
||||
// Error in input data
|
||||
if ($sender == "" || strlen($token) < 32 || !isset($sites[$site])) {
|
||||
|
||||
Reference in New Issue
Block a user