From 1d4d5c6ae2ca7011db1f750c3cf5048b76ca2c26 Mon Sep 17 00:00:00 2001
From: Oliver Klee <typo3-coding@oliverklee.de>
Date: Sun, 12 Mar 2023 11:15:07 +0100
Subject: [PATCH] [TASK] Make parameter names of GU::revExplode consistent

Now the parameter names are consistent with those of the other
explode-related methods.

Resolves: #100145
Releases: main
Change-Id: Ibd8fd736741a8f1cdad2e33ae3e777412cd383eb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78098
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Josef Glatz <typo3@josefglatz.at>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Josef Glatz <typo3@josefglatz.at>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 .../sysext/core/Classes/Utility/GeneralUtility.php  | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
index 5722a596ecfb..9c8196cb6458 100644
--- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php
+++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
@@ -875,23 +875,24 @@ class GeneralUtility
      *
      * @param string $delimiter Delimiter string to explode with
      * @param string $string The string to explode
-     * @param int $count Number of array entries
+     * @param int $limit Number of array entries
+     *
      * @return list<string> Exploded values
      */
-    public static function revExplode($delimiter, $string, $count = 0)
+    public static function revExplode($delimiter, $string, $limit = 0)
     {
-        // 2 is the (currently, as of 2014-02) most-used value for $count in the core, therefore we check it first
-        if ($count === 2) {
+        // 2 is the (currently, as of 2014-02) most-used value for `$limit` in the core, therefore we check it first
+        if ($limit === 2) {
             $position = strrpos($string, strrev($delimiter));
             if ($position !== false) {
                 return [substr($string, 0, $position), substr($string, $position + strlen($delimiter))];
             }
             return [$string];
         }
-        if ($count <= 1) {
+        if ($limit <= 1) {
             return [$string];
         }
-        $explodedValues = explode($delimiter, strrev($string), $count);
+        $explodedValues = explode($delimiter, strrev($string), $limit);
         $explodedValues = array_map('strrev', $explodedValues);
         return array_reverse($explodedValues);
     }
-- 
GitLab