Do not use each() anymore (breaks on PHP 8)
authorChristian Weiske <cweiske@cweiske.de>
Tue, 21 Mar 2023 16:53:07 +0000 (17:53 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 21 Mar 2023 16:53:07 +0000 (17:53 +0100)
src/phorkie/Repository/LinkbackReceiver.php
www/setup.php

index c808f4587352c9a8c8d7e1f444d14a9842c687af..1bb466433a1fe49450072d0511c048a28f7b5091 100644 (file)
@@ -46,7 +46,8 @@ class Repository_LinkbackReceiver
         $remoteCloneUrl = $remoteTitle = null;
         if (count($arRemoteCloneUrls)) {
             reset($arRemoteCloneUrls);
-            list($remoteCloneUrl, $remoteTitle) = each($arRemoteCloneUrls);
+            $remoteCloneUrl = key($arRemoteCloneUrls);
+            $remoteTitle    = current($arRemoteCloneUrls);
         }
         $remoteid = 'fork-' . uniqid();
         //check if we already know this remote
index 909306f06e179051dc841e25d35feb2bb6f24587..634a11aa539653ad89f16ffef39331128a949546 100644 (file)
@@ -99,7 +99,7 @@ HTM;
 if (array_sum($GLOBALS['phorkie']['cfgfiles']) == 0) {
     //no config file loaded
     reset($GLOBALS['phorkie']['cfgfiles']);
-    list($cfgFilePath, ) = each($GLOBALS['phorkie']['cfgfiles']);
+    $cfgFilePath = key($GLOBALS['phorkie']['cfgfiles']);
 
     $cfgFilePath = Tools::foldPath($cfgFilePath);
     $cfgFileTemplate = htmlspecialchars(