Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2023-12-06T18:57:11Z

Commit: 
https://github.com/php/web-php/commit/4ac417b3cb0b42ada04594427614bf9a2a104a01
Raw diff: 
https://github.com/php/web-php/commit/4ac417b3cb0b42ada04594427614bf9a2a104a01.diff

Fix: Remove assignment from condition (#870)

Changed paths:
  M  include/branches.inc


Diff:

diff --git a/include/branches.inc b/include/branches.inc
index f31ab8567b..e0b098aeab 100644
--- a/include/branches.inc
+++ b/include/branches.inc
@@ -99,7 +99,9 @@ function get_all_branches() {
 
     foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) {
         foreach ($releases as $version => $release) {
-            if ($branch = version_number_to_branch($version)) {
+            $branch = version_number_to_branch($version);
+
+            if ($branch) {
                 if (!isset($branches[$major][$branch]) || 
version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
                     $branches[$major][$branch] = $release;
                     $branches[$major][$branch]['version'] = $version;
@@ -110,7 +112,9 @@ function get_all_branches() {
 
     foreach ($GLOBALS['RELEASES'] as $major => $releases) {
         foreach ($releases as $version => $release) {
-            if ($branch = version_number_to_branch($version)) {
+            $branch = version_number_to_branch($version);
+
+            if ($branch) {
                 if (!isset($branches[$major][$branch]) || 
version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
                     $branches[$major][$branch] = $release;
                     $branches[$major][$branch]['version'] = $version;
@@ -133,7 +137,9 @@ function get_active_branches($include_recent_eols = true) {
 
     foreach ($GLOBALS['RELEASES'] as $major => $releases) {
         foreach ($releases as $version => $release) {
-            if ($branch = version_number_to_branch($version)) {
+            $branch = version_number_to_branch($version);
+
+            if ($branch) {
                 $threshold = get_branch_security_eol_date($branch);
                 if ($threshold === null) {
                     // No EOL date available, assume it is ancient.
@@ -168,7 +174,9 @@ function get_eol_branches($always_include = null) {
     // Gather the last release on each branch into a convenient array.
     foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) {
         foreach ($releases as $version => $release) {
-            if ($branch = version_number_to_branch($version)) {
+            $branch = version_number_to_branch($version);
+
+            if ($branch) {
                 if (!isset($branches[$major][$branch]) || 
version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
                     $branches[$major][$branch] = [
                         'date' => strtotime($release['date']),
@@ -184,7 +192,9 @@ function get_eol_branches($always_include = null) {
      * the $RELEASES array and not explicitly marked as EOL there". */
     foreach ($GLOBALS['RELEASES'] as $major => $releases) {
         foreach ($releases as $version => $release) {
-            if ($branch = version_number_to_branch($version)) {
+            $branch = version_number_to_branch($version);
+
+            if ($branch) {
                 if ($now < get_branch_security_eol_date($branch)) {
                     /* This branch isn't EOL: remove it from our array. */
                     if (isset($branches[$major][$branch])) {
@@ -207,7 +217,9 @@ function get_eol_branches($always_include = null) {
 
             if (isset($GLOBALS['RELEASES'][$major][$version])) {
                 $release = $GLOBALS['RELEASES'][$major][$version];
-                if ($branch = version_number_to_branch($version)) {
+                $branch = version_number_to_branch($version);
+
+                if ($branch) {
                     $branches[$major][$branch] = [
                         'date' => strtotime($release['source'][0]['date']),
                         'link' => "/downloads#v$version",

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to