[TASK] Remove has-call to caching framework in explodeSoftRefParserList 52/50752/3
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 22 Nov 2016 22:22:07 +0000 (23:22 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 1 Dec 2016 18:53:54 +0000 (19:53 +0100)
No need to call has on the caching framework in the function
explodeSoftRefParserList. Furthermore we do not need to store false
to the runtime cache if parseList is an empty string.

Resolves: #78773
Releases: master
Change-Id: Iaa3fae35d4d07a78eb0fde8efc892a9ddb46b974
Reviewed-on: https://review.typo3.org/50752
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Robert van Kammen <rvkammen@hotmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index d26b62c..fb5cc0f 100644 (file)
@@ -4103,21 +4103,22 @@ class BackendUtility
      *
      * @param string $parserList softRef parser list
      * @return array|bool Array where the parser key is the key and the value is the parameter string, FALSE if no parsers were found
+     * @throws \InvalidArgumentException
      */
     public static function explodeSoftRefParserList($parserList)
     {
-        $runtimeCache = self::getRuntimeCache();
-        $cacheId = 'backend-softRefList-' . md5($parserList);
-        if ($runtimeCache->has($cacheId)) {
-            return $runtimeCache->get($cacheId);
-        }
-
         // Return immediately if list is blank:
         if ($parserList === '') {
-            $runtimeCache->set($cacheId, false);
             return false;
         }
 
+        $runtimeCache = self::getRuntimeCache();
+        $cacheId = 'backend-softRefList-' . md5($parserList);
+        $parserListCache = $runtimeCache->get($cacheId);
+        if ($parserListCache !== false) {
+            return $parserListCache;
+        }
+
         // Otherwise parse the list:
         $keyList = GeneralUtility::trimExplode(',', $parserList, true);
         $output = [];