[BUGFIX] Replace PHP 7.2 deprecated each()
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Configuration / TypoScript / ConditionMatching / ConditionMatcher.php
index 6d5d92f..a3b93f4 100644 (file)
@@ -139,17 +139,22 @@ class ConditionMatcher extends AbstractConditionMatcher
         if ($id = (int)GeneralUtility::_GP('id')) {
             $pageId = $id;
         } elseif (is_array($editStatement)) {
-            list($table, $uidAndAction) = each($editStatement);
-            list($uid, $action) = each($uidAndAction);
+            $table = key($editStatement);
+            $uidAndAction = current($editStatement);
+            $uid = key($uidAndAction);
+            $action = current($uidAndAction);
             if ($action === 'edit') {
                 $pageId = $this->getPageIdByRecord($table, $uid);
             } elseif ($action === 'new') {
                 $pageId = $this->getPageIdByRecord($table, $uid, true);
             }
         } elseif (is_array($commandStatement)) {
-            list($table, $uidActionAndTarget) = each($commandStatement);
-            list($uid, $actionAndTarget) = each($uidActionAndTarget);
-            list($action, $target) = each($actionAndTarget);
+            $table = key($commandStatement);
+            $uidActionAndTarget = current($commandStatement);
+            $uid = key($uidActionAndTarget);
+            $actionAndTarget = current($uidActionAndTarget);
+            $action = key($actionAndTarget);
+            $target = current($actionAndTarget);
             if ($action === 'delete') {
                 $pageId = $this->getPageIdByRecord($table, $uid);
             } elseif ($action === 'copy' || $action === 'move') {