diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php index 65298a83b372a68676391048622c610da7e117d1..026b1411498a9ce481e603373e5da6abf6e5c9cd 100644 --- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php +++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php @@ -528,33 +528,6 @@ class GeneralUtility return str_contains(',' . $list . ',', ',' . $item . ','); } - /** - * Removes an item from a comma-separated list of items. - * - * If $element contains a comma, the behaviour of this method is undefined. - * Empty elements in the list are preserved. - * - * @param string $element Element to remove - * @param string $list Comma-separated list of items (string) - * @return string New comma-separated list of items - * @deprecated since v11, will be removed in v12. - */ - public static function rmFromList($element, $list) - { - trigger_error( - 'GeneralUtility::rmFromList() is deprecated and will be removed in v12.', - E_USER_DEPRECATED - ); - - $items = explode(',', $list); - foreach ($items as $k => $v) { - if ($v == $element) { - unset($items[$k]); - } - } - return implode(',', $items); - } - /** * Expand a comma-separated list of integers with ranges (eg 1,3-5,7 becomes 1,3,4,5,7). * Ranges are limited to 1000 values per range. 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 1f65efdc5fb828bbd6070367f571962062268aa1..6d4dbecc0b985f3faa33087aa455ea04ecdccbc7 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 @@ -48,6 +48,7 @@ The following PHP static class methods that have previously been marked as depre - :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::softRefParserObj()` - :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::explodeSoftRefParserList()` - :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick` +- :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList()` - :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::stdAuthCode()` - :php:`\TYPO3\CMS\Core\Utility\HttpUtility::redirect()` - :php:`\TYPO3\CMS\Core\Utility\HttpUtility::setResponseCode()` diff --git a/typo3/sysext/core/Tests/UnitDeprecated/Utility/GeneralUtilityTest.php b/typo3/sysext/core/Tests/UnitDeprecated/Utility/GeneralUtilityTest.php index 36db2249552f18fc471ead3e891566f0a34db6ba..f62d5474fbd18162acebf2b9dc4af74935dd2763 100644 --- a/typo3/sysext/core/Tests/UnitDeprecated/Utility/GeneralUtilityTest.php +++ b/typo3/sysext/core/Tests/UnitDeprecated/Utility/GeneralUtilityTest.php @@ -47,46 +47,6 @@ class GeneralUtilityTest extends UnitTestCase self::assertSame($expected, $result); } - /** - * @test - * @dataProvider rmFromListRemovesElementsFromCommaSeparatedListDataProvider - * - * @param string $initialList - * @param string $listWithElementRemoved - */ - public function rmFromListRemovesElementsFromCommaSeparatedList( - string $initialList, - string $listWithElementRemoved - ): void { - self::assertSame($listWithElementRemoved, GeneralUtility::rmFromList('removeme', $initialList)); - } - - /** - * Data provider for rmFromListRemovesElementsFromCommaSeparatedList - * - * @return array - */ - public function rmFromListRemovesElementsFromCommaSeparatedListDataProvider(): array - { - return [ - 'Element as second element of three' => ['one,removeme,two', 'one,two'], - 'Element at beginning of list' => ['removeme,one,two', 'one,two'], - 'Element at end of list' => ['one,two,removeme', 'one,two'], - 'One item list' => ['removeme', ''], - 'Element not contained in list' => ['one,two,three', 'one,two,three'], - 'Empty element survives' => ['one,,three,,removeme', 'one,,three,'], - 'Empty element survives at start' => [',removeme,three,removeme', ',three'], - 'Empty element survives at end' => ['removeme,three,removeme,', 'three,'], - 'Empty list' => ['', ''], - 'List contains removeme multiple times' => ['removeme,notme,removeme,removeme', 'notme'], - 'List contains removeme multiple times nothing else' => ['removeme,removeme,removeme', ''], - 'List contains removeme multiple times nothing else 2x' => ['removeme,removeme', ''], - 'List contains removeme multiple times nothing else 3x' => ['removeme,removeme,removeme', ''], - 'List contains removeme multiple times nothing else 4x' => ['removeme,removeme,removeme,removeme', ''], - 'List contains removeme multiple times nothing else 5x' => ['removeme,removeme,removeme,removeme,removeme', ''], - ]; - } - /////////////////////////////// // Tests concerning isFirstPartOfStr /////////////////////////////// diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php index 2b8847e0ef3e251dc8512a550900597600f89758..5b9016332673fa1dfd8935852a5d426364042132 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php @@ -1094,6 +1094,7 @@ return [ 'maximumNumberOfArguments' => 2, 'restFiles' => [ 'Deprecation-94311-DeprecatedGeneralUtilityrmFromList.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5' => [