Skip to content

Commit 4ac417b

Browse files
authored
Fix: Remove assignment from condition (php#870)
1 parent ede0692 commit 4ac417b

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

include/branches.inc

+18-6
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ function get_all_branches() {
9999

100100
foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) {
101101
foreach ($releases as $version => $release) {
102-
if ($branch = version_number_to_branch($version)) {
102+
$branch = version_number_to_branch($version);
103+
104+
if ($branch) {
103105
if (!isset($branches[$major][$branch]) || version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
104106
$branches[$major][$branch] = $release;
105107
$branches[$major][$branch]['version'] = $version;
@@ -110,7 +112,9 @@ function get_all_branches() {
110112

111113
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
112114
foreach ($releases as $version => $release) {
113-
if ($branch = version_number_to_branch($version)) {
115+
$branch = version_number_to_branch($version);
116+
117+
if ($branch) {
114118
if (!isset($branches[$major][$branch]) || version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
115119
$branches[$major][$branch] = $release;
116120
$branches[$major][$branch]['version'] = $version;
@@ -133,7 +137,9 @@ function get_active_branches($include_recent_eols = true) {
133137

134138
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
135139
foreach ($releases as $version => $release) {
136-
if ($branch = version_number_to_branch($version)) {
140+
$branch = version_number_to_branch($version);
141+
142+
if ($branch) {
137143
$threshold = get_branch_security_eol_date($branch);
138144
if ($threshold === null) {
139145
// No EOL date available, assume it is ancient.
@@ -168,7 +174,9 @@ function get_eol_branches($always_include = null) {
168174
// Gather the last release on each branch into a convenient array.
169175
foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) {
170176
foreach ($releases as $version => $release) {
171-
if ($branch = version_number_to_branch($version)) {
177+
$branch = version_number_to_branch($version);
178+
179+
if ($branch) {
172180
if (!isset($branches[$major][$branch]) || version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
173181
$branches[$major][$branch] = [
174182
'date' => strtotime($release['date']),
@@ -184,7 +192,9 @@ function get_eol_branches($always_include = null) {
184192
* the $RELEASES array and not explicitly marked as EOL there". */
185193
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
186194
foreach ($releases as $version => $release) {
187-
if ($branch = version_number_to_branch($version)) {
195+
$branch = version_number_to_branch($version);
196+
197+
if ($branch) {
188198
if ($now < get_branch_security_eol_date($branch)) {
189199
/* This branch isn't EOL: remove it from our array. */
190200
if (isset($branches[$major][$branch])) {
@@ -207,7 +217,9 @@ function get_eol_branches($always_include = null) {
207217

208218
if (isset($GLOBALS['RELEASES'][$major][$version])) {
209219
$release = $GLOBALS['RELEASES'][$major][$version];
210-
if ($branch = version_number_to_branch($version)) {
220+
$branch = version_number_to_branch($version);
221+
222+
if ($branch) {
211223
$branches[$major][$branch] = [
212224
'date' => strtotime($release['source'][0]['date']),
213225
'link' => "/downloads#v$version",

0 commit comments

Comments
 (0)