From: Christian Weiske Date: Tue, 21 Mar 2023 16:53:07 +0000 (+0100) Subject: Do not use each() anymore (breaks on PHP 8) X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/e9867d24b944b1c9c71c2c6c214cb80ba628c0b9 Do not use each() anymore (breaks on PHP 8) --- diff --git a/src/phorkie/Repository/LinkbackReceiver.php b/src/phorkie/Repository/LinkbackReceiver.php index c808f45..1bb4664 100644 --- a/src/phorkie/Repository/LinkbackReceiver.php +++ b/src/phorkie/Repository/LinkbackReceiver.php @@ -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 diff --git a/www/setup.php b/www/setup.php index 909306f..634a11a 100644 --- a/www/setup.php +++ b/www/setup.php @@ -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(