From e2a21d2a576b4c02714a510bffd62956d7883d93 Mon Sep 17 00:00:00 2001
From: Oliver Bartsch <bo@cedev.de>
Date: Mon, 29 Nov 2021 15:42:00 +0100
Subject: [PATCH] [!!!][TASK] Remove GeneralUtility::uniqueList

In #92607, GeneralUtility::uniqueList was migrated
to StringUtility::uniqueList and is therefore now
removed.

Resolves: #96139
Related: #92607
Releases: main
Change-Id: I3eceb459db75a6cb69ed93126516abc2603ba9f6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72374
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
---
 .../core/Classes/Utility/GeneralUtility.php   | 24 -------------------
 ...g-96107-DeprecatedFunctionalityRemoved.rst |  1 +
 .../Php/MethodCallStaticMatcher.php           |  1 +
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
index 026b1411498a..9b70dc03ed09 100644
--- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php
+++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
@@ -613,30 +613,6 @@ class GeneralUtility
         return $hmac;
     }
 
-    /**
-     * Takes comma-separated lists and arrays and removes all duplicates
-     * If a value in the list is trim(empty), the value is ignored.
-     *
-     * @param string $in_list Accept multiple parameters which can be comma-separated lists of values and arrays.
-     * @param mixed $secondParameter Dummy field, which if set will show a warning!
-     * @return string Returns the list without any duplicates of values, space around values are trimmed
-     * @deprecated since TYPO3 v11, will be removed in TYPO3 v12. Use StringUtility::uniqueList() instead.
-     */
-    public static function uniqueList($in_list, $secondParameter = null)
-    {
-        trigger_error(
-            'GeneralUtility::uniqueList() is deprecated and will be removed in v12. Use StringUtility::uniqueList() instead.',
-            E_USER_DEPRECATED
-        );
-        if (is_array($in_list)) {
-            throw new \InvalidArgumentException('TYPO3 Fatal Error: TYPO3\\CMS\\Core\\Utility\\GeneralUtility::uniqueList() does NOT support array arguments anymore! Only string comma lists!', 1270853885);
-        }
-        if (isset($secondParameter)) {
-            throw new \InvalidArgumentException('TYPO3 Fatal Error: TYPO3\\CMS\\Core\\Utility\\GeneralUtility::uniqueList() does NOT support more than a single argument value anymore. You have specified more than one!', 1270853886);
-        }
-        return implode(',', array_unique(self::trimExplode(',', $in_list, true)));
-    }
-
     /**
      * Splits a reference to a file in 5 parts
      *
diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst
index ac032dc0db7a..629af2cc1993 100644
--- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst
+++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst
@@ -58,6 +58,7 @@ The following PHP static class methods that have previously been marked as depre
 - :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable()`
 - :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList()`
 - :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::stdAuthCode()`
+- :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::uniqueList()`
 - :php:`\TYPO3\CMS\Core\Utility\HttpUtility::redirect()`
 - :php:`\TYPO3\CMS\Core\Utility\HttpUtility::setResponseCode()`
 - :php:`\TYPO3\CMS\Core\Utility\HttpUtility::setResponseCodeAndExit()`
diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
index b41295205662..cd0156b515af 100644
--- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
+++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
@@ -1065,6 +1065,7 @@ return [
         'maximumNumberOfArguments' => 2,
         'restFiles' => [
             'Deprecation-92607-DeprecatedGeneralUtilityuniqueList.rst',
+            'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Core\Database\RelationHandler::isOnSymmetricSide' => [
-- 
GitLab