From 4d0c984930d4835876733dd68d8968c254d5d5cd Mon Sep 17 00:00:00 2001
From: Torben Hansen <derhansen@gmail.com>
Date: Mon, 28 Aug 2023 15:52:43 +0200
Subject: [PATCH] [TASK] Ensure short list syntax is used

With #90002, all occurrences of the `list()` function have been migrated
to the short list syntax. Our php-cs-fixer configuration does however
not check the short list syntax usage, so we have one usage of `list()`
in our codebase again.

This change extends the php-cs-fixer configuration to ensure, that
only the short list syntax is used. The new ruleset has been applied
to the codebase and one usage of the `list()` function has been migrated.

Resolves: #101777
Related: #90002
Releases: main, 12.4
Signed-off-by: Torben Hansen <derhansen@gmail.com>
Change-Id: I30f5822e27a36515c2c77a19089a0754ff6fdcfd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80684
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
---
 Build/php-cs-fixer/config.php                           | 1 +
 typo3/sysext/impexp/Classes/View/ExportPageTreeView.php | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Build/php-cs-fixer/config.php b/Build/php-cs-fixer/config.php
index 4cc0616ffaa9..87cb160403eb 100644
--- a/Build/php-cs-fixer/config.php
+++ b/Build/php-cs-fixer/config.php
@@ -59,6 +59,7 @@ return (new \PhpCsFixer\Config())
         'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
         'function_typehint_space' => true,
         'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false],
+        'list_syntax' => ['syntax' => 'short'],
         'modernize_strpos' => true,
         'modernize_types_casting' => true,
         'native_function_casing' => true,
diff --git a/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php b/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php
index faba22d91293..f22d22f44597 100644
--- a/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php
+++ b/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php
@@ -186,7 +186,7 @@ class ExportPageTreeView extends AbstractTreeView
 
         $this->stored = [];
         foreach ($pageTreeState as $identifier => $isExpanded) {
-            list($bank, $pageId) = explode('_', $identifier);
+            [$bank, $pageId] = explode('_', $identifier);
             $this->stored[$bank][$pageId] = $isExpanded;
         }
     }
-- 
GitLab