[TASK] Update php-cs-fixer to 2.5.0 95/53795/2
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 23 Aug 2017 16:45:54 +0000 (18:45 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 23 Aug 2017 20:04:37 +0000 (22:04 +0200)
Add 2 new rules

* no_superfluous_elseif
* no_useless_else

Both rules only apply if the if-statement contains a return. If this
is the case the obsolete else/elseif part is dropped.

Resolves: #82183
Releases: master,8.7
Change-Id: I94dfa6b5b96cbc3e350bd778f1796dda1a4d955a
Reviewed-on: https://review.typo3.org/53795
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
205 files changed:
Build/.php_cs
composer.lock
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
typo3/sysext/backend/Classes/Console/CliRequestHandler.php
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/File/FileController.php
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
typo3/sysext/backend/Classes/Form/Container/PaletteAndSingleContainer.php
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
typo3/sysext/backend/Classes/Form/FieldWizard/OtherLanguageContent.php
typo3/sysext/backend/Classes/Form/FieldWizard/SelectIcons.php
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowDateTimeFields.php
typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsProcessFieldLabels.php
typo3/sysext/backend/Classes/Form/InlineStackProcessor.php
typo3/sysext/backend/Classes/Form/Wizard/ImageManipulationWizard.php
typo3/sysext/backend/Classes/Http/RouteDispatcher.php
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php
typo3/sysext/backend/Classes/Tree/SortedTreeNodeCollection.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Tree/View/ContentLayoutPagePositionMap.php
typo3/sysext/backend/Classes/Tree/View/ElementBrowserFolderTreeView.php
typo3/sysext/backend/Classes/Tree/View/ElementBrowserPageTreeView.php
typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/BackendLayoutView.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Classes/View/PageTreeView.php
typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php
typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Cache/Backend/ApcBackend.php
typo3/sysext/core/Classes/Cache/Backend/ApcuBackend.php
typo3/sysext/core/Classes/Cache/Backend/FileBackend.php
typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php
typo3/sysext/core/Classes/Cache/Backend/TransientMemoryBackend.php
typo3/sysext/core/Classes/Cache/Backend/WincacheBackend.php
typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php
typo3/sysext/core/Classes/Charset/CharsetConverter.php
typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Classes/Controller/FileDumpController.php
typo3/sysext/core/Classes/Core/ClassLoadingInformation.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/DataHandling/Localization/DataMapItem.php
typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Database/Query/QueryHelper.php
typo3/sysext/core/Classes/Database/ReferenceIndex.php
typo3/sysext/core/Classes/Database/Schema/ConnectionMigrator.php
typo3/sysext/core/Classes/Error/ErrorHandler.php
typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectApi.php
typo3/sysext/core/Classes/Http/Message.php
typo3/sysext/core/Classes/Http/ServerRequest.php
typo3/sysext/core/Classes/Http/ServerRequestFactory.php
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/core/Classes/Imaging/ImageManipulation/Area.php
typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariantCollection.php
typo3/sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php
typo3/sysext/core/Classes/LinkHandling/LinkService.php
typo3/sysext/core/Classes/Localization/LanguageStore.php
typo3/sysext/core/Classes/Mail/Rfc822AddressesParser.php
typo3/sysext/core/Classes/Migrations/TcaMigration.php
typo3/sysext/core/Classes/Package/PackageManager.php
typo3/sysext/core/Classes/Resource/AbstractFile.php
typo3/sysext/core/Classes/Resource/Collection/FileCollectionRegistry.php
typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php
typo3/sysext/core/Classes/Resource/File.php
typo3/sysext/core/Classes/Resource/Filter/FileNameFilter.php
typo3/sysext/core/Classes/Resource/Index/ExtractorRegistry.php
typo3/sysext/core/Classes/Resource/ProcessedFile.php
typo3/sysext/core/Classes/Resource/Processing/LocalImageProcessor.php
typo3/sysext/core/Classes/Resource/Rendering/RendererRegistry.php
typo3/sysext/core/Classes/Resource/ResourceFactory.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Classes/Service/DependencyOrderingService.php
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Classes/Utility/MailUtility.php
typo3/sysext/core/Classes/Utility/MathUtility.php
typo3/sysext/core/Classes/Utility/RootlineUtility.php
typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/HookTest.php
typo3/sysext/core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureParsePreProcessHookReturnString.php
typo3/sysext/core/Tests/Unit/Resource/Driver/Fixtures/LocalDriverFilenameFilter.php
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/documentation/Classes/Service/DocumentationService.php
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php
typo3/sysext/extbase/Classes/Error/Message.php
typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php
typo3/sysext/extbase/Classes/Mvc/View/JsonView.php
typo3/sysext/extbase/Classes/Mvc/Web/Request.php
typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php
typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php
typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php
typo3/sysext/extbase/Classes/Persistence/Repository.php
typo3/sysext/extbase/Classes/Property/PropertyMapper.php
typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php
typo3/sysext/extbase/Classes/Property/TypeConverter/DateTimeConverter.php
typo3/sysext/extbase/Classes/Property/TypeConverter/ObjectConverter.php
typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php
typo3/sysext/extbase/Classes/Reflection/ReflectionService.php
typo3/sysext/extbase/Classes/Service/ImageService.php
typo3/sysext/extbase/Classes/SignalSlot/Dispatcher.php
typo3/sysext/extbase/Classes/Utility/ArrayUtility.php
typo3/sysext/extbase/Classes/Utility/DebuggerUtility.php
typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
typo3/sysext/extbase/Classes/Utility/TypeHandlingUtility.php
typo3/sysext/extbase/Classes/Validation/Validator/CollectionValidator.php
typo3/sysext/extbase/Classes/Validation/Validator/GenericObjectValidator.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
typo3/sysext/extensionmanager/Classes/Utility/DependencyUtility.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/DownloadExtensionViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/InstallationStateCssClassViewHelper.php
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractConditionViewHelper.php
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfAuthenticatedViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfHasRoleViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/Select/OptionViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/MediaViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Security/IfAuthenticatedViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Security/IfHasRoleViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Uri/EmailViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php
typo3/sysext/form/Classes/Domain/Model/FormDefinition.php
typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php
typo3/sysext/form/Classes/Mvc/Property/TypeConverter/UploadedFileReferenceConverter.php
typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
typo3/sysext/frontend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Page/ExternalPageUrlHandler.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php
typo3/sysext/frontend/Classes/Resource/FileCollector.php
typo3/sysext/frontend/Classes/Typolink/AbstractTypolinkBuilder.php
typo3/sysext/impexp/Classes/Import.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/indexed_search/Classes/Lexer.php
typo3/sysext/indexed_search/Classes/Utility/DoubleMetaPhoneUtility.php
typo3/sysext/install/Classes/Controller/Action/Ajax/ExtensionCompatibilityTester.php
typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php
typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php
typo3/sysext/install/Classes/FolderStructure/AbstractNode.php
typo3/sysext/install/Classes/Service/EnableFileService.php
typo3/sysext/install/Classes/Service/SessionService.php
typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php
typo3/sysext/install/Classes/SystemEnvironment/Check.php
typo3/sysext/install/Classes/Updates/AbstractUpdate.php
typo3/sysext/install/Classes/Updates/DatabaseRowsUpdateWizard.php
typo3/sysext/install/Classes/Updates/WorkspacesNotificationSettingsUpdate.php
typo3/sysext/lang/Classes/LanguageService.php
typo3/sysext/lang/Classes/Service/TerService.php
typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php
typo3/sysext/linkvalidator/Classes/Task/ValidatorTaskAdditionalFieldProvider.php
typo3/sysext/recordlist/Classes/LinkHandler/FolderLinkHandler.php
typo3/sysext/recordlist/Classes/LinkHandler/PageLinkHandler.php
typo3/sysext/recycler/Classes/Task/CleanerFieldProvider.php
typo3/sysext/recycler/Classes/Utility/RecyclerUtility.php
typo3/sysext/saltedpasswords/Classes/Task/BulkUpdateTask.php
typo3/sysext/saltedpasswords/Classes/Utility/SaltedPasswordsUtility.php
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Classes/Scheduler.php
typo3/sysext/scheduler/Classes/Task/FileStorageExtractionAdditionalFieldProvider.php
typo3/sysext/scheduler/Classes/Task/FileStorageIndexingAdditionalFieldProvider.php
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/version/Classes/Dependency/ElementEntity.php
typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php
typo3/sysext/workspaces/Classes/Controller/Remote/ActionHandler.php
typo3/sysext/workspaces/Classes/Domain/Record/StageRecord.php
typo3/sysext/workspaces/Classes/Hook/PreviewHook.php
typo3/sysext/workspaces/Classes/Service/GridDataService.php
typo3/sysext/workspaces/Classes/Service/IntegrityService.php
typo3/sysext/workspaces/Classes/Service/StagesService.php
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php

index 7259893..44fc0e8 100644 (file)
@@ -77,6 +77,8 @@ return PhpCsFixer\Config::create()
         'no_unneeded_control_parentheses' => true,
         'phpdoc_no_empty_return' => true,
         'no_blank_lines_after_phpdoc' => true,
-        'phpdoc_trim' => true
+        'phpdoc_trim' => true,
+        'no_superfluous_elseif' => true,
+        'no_useless_else' => true,
     ])
     ->setFinder($finder);
index ad84e68..7378067 100644 (file)
         },
         {
             "name": "friendsofphp/php-cs-fixer",
-            "version": "v2.4.1",
+            "version": "v2.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
-                "reference": "b4983586c8e7b1f99ec05dd1e75c8b673315da70"
+                "reference": "63aad575ec2a29d50eb6c3b5cbc17430b28895b2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/b4983586c8e7b1f99ec05dd1e75c8b673315da70",
-                "reference": "b4983586c8e7b1f99ec05dd1e75c8b673315da70",
+                "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/63aad575ec2a29d50eb6c3b5cbc17430b28895b2",
+                "reference": "63aad575ec2a29d50eb6c3b5cbc17430b28895b2",
                 "shasum": ""
             },
             "require": {
                 "gecko-packages/gecko-php-unit": "^2.0",
                 "php": "^5.6 || >=7.0 <7.2",
                 "sebastian/diff": "^1.4",
-                "symfony/console": "^3.0",
+                "symfony/console": "^3.2",
                 "symfony/event-dispatcher": "^3.0",
                 "symfony/filesystem": "^3.0",
                 "symfony/finder": "^3.0",
             "require-dev": {
                 "johnkary/phpunit-speedtrap": "^1.1",
                 "justinrainbow/json-schema": "^5.0",
+                "php-cs-fixer/accessible-object": "^1.0",
                 "phpunit/phpunit": "^4.8.35 || ^5.4.3",
                 "satooshi/php-coveralls": "^1.0",
                 "symfony/phpunit-bridge": "^3.2.2"
                 "php-cs-fixer"
             ],
             "type": "application",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.4-dev"
-                }
-            },
             "autoload": {
                 "psr-4": {
                     "PhpCsFixer\\": "src/"
                 }
             ],
             "description": "A tool to automatically fix PHP code style",
-            "time": "2017-08-22T14:11:01+00:00"
+            "time": "2017-08-22T14:15:09+00:00"
         },
         {
             "name": "gecko-packages/gecko-php-unit",
index a036b89..ab06d41 100644 (file)
@@ -114,16 +114,15 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
     {
         if ($this->hasDropDown()) {
             return $this->getFluidTemplateObject('ClearCacheToolbarItem.html')->render();
-        } else {
-            $view = $this->getFluidTemplateObject('ClearCacheToolbarItemSingle.html');
-            $cacheAction = end($this->cacheActions);
-            $view->assignMultiple([
+        }
+        $view = $this->getFluidTemplateObject('ClearCacheToolbarItemSingle.html');
+        $cacheAction = end($this->cacheActions);
+        $view->assignMultiple([
                 'link'  => $cacheAction['href'],
                 'title' => $cacheAction['title'],
                 'iconIdentifier'  => $cacheAction['iconIdentifier'],
             ]);
-            return $view->render();
-        }
+        return $view->render();
     }
 
     /**
index f31a9ad..a4dd662 100644 (file)
@@ -655,9 +655,8 @@ class ShortcutToolbarItem implements ToolbarItemInterface
 
         if ($affectedRows === 1) {
             return 'success';
-        } else {
-            return 'failed';
         }
+        return 'failed';
     }
 
     /**
index 834d2b0..17a3661 100644 (file)
@@ -47,8 +47,8 @@ class ConditionMatcher extends AbstractConditionMatcher
         $result = $this->evaluateConditionCommon($key, $value);
         if (is_bool($result)) {
             return $result;
-        } else {
-            switch ($key) {
+        }
+        switch ($key) {
                 case 'usergroup':
                     $groupList = $this->getGroupList();
                     $values = GeneralUtility::trimExplode(',', $value, true);
@@ -95,7 +95,7 @@ class ConditionMatcher extends AbstractConditionMatcher
                         return $conditionResult;
                     }
             }
-        }
+
         return false;
     }
 
index 6f25a65..64dae82 100644 (file)
@@ -130,7 +130,8 @@ class CliRequestHandler implements RequestHandlerInterface
         $cliKey = $input->getFirstArgument();
         if (empty($cliKey)) {
             throw new \InvalidArgumentException('This script must have a command as first argument.', 1476107418);
-        } elseif (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$cliKey])) {
+        }
+        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$cliKey])) {
             throw new \InvalidArgumentException('This supplied command is not valid.', 1476107480);
         }
         return $cliKey;
index 6d2dc0c..ee354cd 100644 (file)
@@ -814,9 +814,8 @@ class BackendController
                                        // start in module:
                                top.startInModule = [' . GeneralUtility::quoteJSvalue($startModule) . ', ' . GeneralUtility::quoteJSvalue($moduleParameters) . '];
                        ';
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
index 73e0db0..08203cd 100644 (file)
@@ -508,12 +508,11 @@ class NewContentElementController extends AbstractModule
                             // Remove element all together:
                             unset($wizardItems[$key]);
                             break;
-                        } else {
-                            // Add the parameter:
-                            $wizardItems[$key]['params'] .= '&defVals[tt_content][' . $fN . ']=' . rawurlencode($this->getLanguageService()->sL($fV));
-                            $tmp = explode('_', $key);
-                            $headersUsed[$tmp[0]] = $tmp[0];
                         }
+                        // Add the parameter:
+                        $wizardItems[$key]['params'] .= '&defVals[tt_content][' . $fN . ']=' . rawurlencode($this->getLanguageService()->sL($fV));
+                        $tmp = explode('_', $key);
+                        $headersUsed[$tmp[0]] = $tmp[0];
                     }
                 }
             }
index ab14022..e03f709 100644 (file)
@@ -1810,30 +1810,26 @@ class EditDocumentController extends AbstractModule
                         // that is handled inside DataHandler then and in the interface it would clearly be an error of
                         // links if the user accesses such a scenario)
                         return $reqRecord;
-                    } else {
-                        // The input record was online and an offline version must be found or made:
-                        // Look for version of this workspace:
-                        $versionRec = BackendUtility::getWorkspaceVersionOfRecord(
+                    }
+                    // The input record was online and an offline version must be found or made:
+                    // Look for version of this workspace:
+                    $versionRec = BackendUtility::getWorkspaceVersionOfRecord(
                             $this->getBackendUser()->workspace,
                             $table,
                             $reqRecord['uid'],
                             'uid,pid,t3ver_oid'
                         );
-                        return is_array($versionRec) ? $versionRec : $reqRecord;
-                    }
-                } else {
-                    // This means that editing cannot occur on this record because it was not supporting versioning
-                    // which is required inside an offline workspace.
-                    return false;
+                    return is_array($versionRec) ? $versionRec : $reqRecord;
                 }
-            } else {
-                // In ONLINE workspace, just return the originally requested record:
-                return $reqRecord;
+                // This means that editing cannot occur on this record because it was not supporting versioning
+                // which is required inside an offline workspace.
+                return false;
             }
-        } else {
-            // Return FALSE because the table/uid was not found anyway.
-            return false;
+            // In ONLINE workspace, just return the originally requested record:
+            return $reqRecord;
         }
+        // Return FALSE because the table/uid was not found anyway.
+        return false;
     }
 
     /**
index 49be98c..a8df2e6 100644 (file)
@@ -185,10 +185,9 @@ class FileController
             return $response
                     ->withHeader('Location', GeneralUtility::locationHeaderUrl($this->redirect))
                     ->withStatus(303);
-        } else {
-            // empty response
-            return $response;
         }
+        // empty response
+        return $response;
     }
 
     /**
index 8361bd9..159d6ef 100644 (file)
@@ -273,10 +273,9 @@ class LoginController
                  */
                 throw new \RuntimeException('Login-error: Yeah, that\'s a classic. No cookies, no TYPO3. ' .
                     'Please accept cookies from TYPO3 - otherwise you\'ll not be able to use the system.', 1294586846);
-            } else {
-                // try it once again - that might be needed for auto login
-                $this->redirectToURL = 'index.php?commandLI=setCookie';
             }
+            // try it once again - that might be needed for auto login
+            $this->redirectToURL = 'index.php?commandLI=setCookie';
         }
         $redirectToUrl = (string)$this->getBackendUserAuthentication()->getTSConfigVal('auth.BE.redirectToURL');
         if (empty($redirectToUrl)) {
index e55f1ed..fc61060 100644 (file)
@@ -622,10 +622,9 @@ class NewRecordController extends AbstractModule
                 $ret = strnatcasecmp($this->tRows[$a]['title'], $this->tRows[$b]['title']);
             }
             return $ret;
-        } else {
-            // Return alphabetic order
-            return strnatcasecmp($this->tRows[$a]['title'], $this->tRows[$b]['title']);
         }
+        // Return alphabetic order
+        return strnatcasecmp($this->tRows[$a]['title'], $this->tRows[$b]['title']);
     }
 
     /**
index f79463e..f8a8c9c 100644 (file)
@@ -717,9 +717,8 @@ class PageLayoutController
                 ->execute()
                 ->fetch();
             return $overlayRecord['title'];
-        } else {
-            return $this->pageinfo['title'];
         }
+        return $this->pageinfo['title'];
     }
 
     /**
index d91c88d..9bec7e6 100644 (file)
@@ -356,8 +356,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
         if ($iconRegistry->isRegistered($iconIdentifier)) {
             $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
             return $iconFactory->getIcon($iconIdentifier)->render();
-        } else {
-            return '';
         }
+        return '';
     }
 }
index 73c8b8d..4641fae 100644 (file)
@@ -232,9 +232,8 @@ class PaletteAndSingleContainer extends AbstractContainer
 
         if ($foundRealElement) {
             return $resultStructure;
-        } else {
-            return [];
         }
+        return [];
     }
 
     /**
index 3a81c16..3b2ea75 100644 (file)
@@ -393,9 +393,8 @@ abstract class AbstractFormElement extends AbstractNode
                     'fieldControl' => [],
                     'fieldWizard' => [],
                 ];
-            } else {
-                return $item;
             }
+            return $item;
         }
 
         $languageService = $this->getLanguageService();
index 68a5a72..ae8c471 100644 (file)
@@ -146,8 +146,7 @@ class OtherLanguageContent extends AbstractNode
                     '</span>';
             }
             return implode('<br />', $imgs);
-        } else {
-            return nl2br(htmlspecialchars($value));
         }
+        return nl2br(htmlspecialchars($value));
     }
 }
index 263c33b..48adc32 100644 (file)
@@ -40,17 +40,16 @@ class SelectIcons extends AbstractNode
         foreach ($selectItems as $item) {
             if ($item[1] === '--div--') {
                 continue;
-            } else {
-                $icon = !empty($item[2]) ? FormEngineUtility::getIconHtml($item[2], $item[0], $item[0]) : '';
-                if ($icon) {
-                    $selectIcons[] = [
+            }
+            $icon = !empty($item[2]) ? FormEngineUtility::getIconHtml($item[2], $item[0], $item[0]) : '';
+            if ($icon) {
+                $selectIcons[] = [
                         'title' => $item[0],
                         'icon' => $icon,
                         'index' => $selectItemCounter,
                     ];
-                }
-                $selectItemCounter++;
             }
+            $selectItemCounter++;
         }
 
         $html = [];
index 6645476..67d3e1b 100644 (file)
@@ -45,10 +45,9 @@ class DatabaseRowDateTimeFields implements FormDataProviderInterface
                 } else {
                     $result['databaseRow'][$column] = null;
                 }
-            } else {
-                // its a UNIX timestamp! We do not modify this here, as it will only be treated as a datetime because
-                // of eval being set to "date" or "datetime". This is handled in InputTextElement then.
             }
+            // its a UNIX timestamp! We do not modify this here, as it will only be treated as a datetime because
+                // of eval being set to "date" or "datetime". This is handled in InputTextElement then.
         }
         return $result;
     }
index ebfc873..362791e 100644 (file)
@@ -874,9 +874,8 @@ class EvaluateDisplayConditions implements FormDataProviderInterface
     {
         if ($condition['isNew']) {
             return !((int)$condition['uid'] > 0);
-        } else {
-            return (int)$condition['uid'] > 0;
         }
+        return (int)$condition['uid'] > 0;
     }
 
     /**
index 904613d..4500421 100644 (file)
@@ -68,7 +68,8 @@ class TcaColumnsProcessFieldLabels implements FormDataProviderInterface
             if ($aShowItemFieldArray['fieldName'] === '--div--') {
                 // tabs are not of interest here
                 continue;
-            } elseif ($aShowItemFieldArray['fieldName'] === '--palette--') {
+            }
+            if ($aShowItemFieldArray['fieldName'] === '--palette--') {
                 // showitem references to a palette field. unpack the palette and process
                 // label overrides that may be in there.
                 if (!isset($result['processedTca']['palettes'][$aShowItemFieldArray['paletteName']]['showitem'])) {
index e0e5b07..790f93e 100644 (file)
@@ -193,9 +193,8 @@ class InlineStackProcessor
 
         if ($level !== false) {
             return $this->inlineStructure['stable'][$level];
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
index 112d956..0c0d150 100644 (file)
@@ -74,9 +74,8 @@ class ImageManipulationWizard
             $response->getBody()->write($content);
 
             return $response;
-        } else {
-            return $response->withStatus(403);
         }
+        return $response->withStatus(403);
     }
 
     /**
index 66a32b8..74d591e 100644 (file)
@@ -78,12 +78,12 @@ class RouteDispatcher extends Dispatcher implements DispatcherInterface
         $route = $request->getAttribute('route');
         if ($route->getOption('access') === 'public') {
             return true;
-        } elseif ($route->getOption('ajax')) {
+        }
+        if ($route->getOption('ajax')) {
             $token = (string)(isset($request->getParsedBody()['ajaxToken']) ? $request->getParsedBody()['ajaxToken'] : $request->getQueryParams()['ajaxToken']);
             return $this->getFormProtection()->validateToken($token, 'ajaxCall', $route->getOption('_identifier'));
-        } else {
-            $token = (string)(isset($request->getParsedBody()['token']) ? $request->getParsedBody()['token'] : $request->getQueryParams()['token']);
-            return $this->getFormProtection()->validateToken($token, 'route', $route->getOption('_identifier'));
         }
+        $token = (string)(isset($request->getParsedBody()['token']) ? $request->getParsedBody()['token'] : $request->getQueryParams()['token']);
+        return $this->getFormProtection()->validateToken($token, 'route', $route->getOption('_identifier'));
     }
 }
index 4ffa127..dc0aec4 100644 (file)
@@ -326,16 +326,15 @@ abstract class AbstractRecordList
                 $code = $this->addElement(1, '', $theData, 'class="fwd_rwd_nav"');
             }
             return [1, $code];
-        } else {
-            if ($this->eCounter == $this->firstElementNumber + $this->iLimit) {
-                //     Forward
-                $theData = [];
-                $titleCol = $this->fieldArray[0];
-                $theData[$titleCol] = $this->fwd_rwd_HTML('rwd', $this->eCounter, $table);
-                $code = $this->addElement(1, '', $theData, 'class="fwd_rwd_nav"');
-            }
-            return [0, $code];
         }
+        if ($this->eCounter == $this->firstElementNumber + $this->iLimit) {
+            //         Forward
+            $theData = [];
+            $titleCol = $this->fieldArray[0];
+            $theData[$titleCol] = $this->fwd_rwd_HTML('rwd', $this->eCounter, $table);
+            $code = $this->addElement(1, '', $theData, 'class="fwd_rwd_nav"');
+        }
+        return [0, $code];
     }
 
     /**
index eccac0d..b1c3007 100644 (file)
@@ -800,9 +800,8 @@ function jumpToUrl(URL) {
        <div>
 ';
             return $str;
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -824,9 +823,8 @@ function jumpToUrl(URL) {
              End output section.
             ********************* -->
 ';
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
index a8554c7..22130cb 100644 (file)
@@ -218,7 +218,8 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider
         $records = $this->getSubpages(-1, $searchFilter);
         if (!is_array($records) || empty($records)) {
             return $nodeCollection;
-        } elseif (count($records) > 500) {
+        }
+        if (count($records) > 500) {
             return $nodeCollection;
         }
         // check no temporary mountpoint is used
index 8f46e58..83bf446 100644 (file)
@@ -58,20 +58,19 @@ class SortedTreeNodeCollection extends \TYPO3\CMS\Backend\Tree\TreeNodeCollectio
             $divider = ceil(($end - $start) / 2);
             if ($this->offsetGet($divider)->equals($node)) {
                 return $divider;
-            } elseif ($this->offsetGet($divider)->compareTo($node) > 0) {
-                return $this->binarySearch($node, $start, $divider - 1);
-            } else {
-                return $this->binarySearch($node, $divider + 1, $end);
             }
-        } else {
-            if ($this->offsetGet($start)->equals($node)) {
-                return $start;
-            } elseif ($this->offsetGet($end)->equals($node)) {
-                return $end;
-            } else {
-                return -1;
+            if ($this->offsetGet($divider)->compareTo($node) > 0) {
+                return $this->binarySearch($node, $start, $divider - 1);
             }
+            return $this->binarySearch($node, $divider + 1, $end);
+        }
+        if ($this->offsetGet($start)->equals($node)) {
+            return $start;
+        }
+        if ($this->offsetGet($end)->equals($node)) {
+            return $end;
         }
+        return -1;
     }
 
     /**
index 15d0d00..9ff4898 100644 (file)
@@ -510,9 +510,8 @@ abstract class AbstractTreeView
             $cmd = $this->bank . '_' . ($isOpen ? '0_' : '1_') . $row['uid'] . '_' . $this->treeName;
             $bMark = $this->bank . '_' . $row['uid'];
             return $this->PM_ATagWrap('', $cmd, $bMark, $isOpen);
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -532,9 +531,8 @@ abstract class AbstractTreeView
             $name = $bMark ? ' name="' . $bMark . '"' : '';
             $aUrl = $this->getThisScript() . 'PM=' . $cmd . $anchor;
             return '<a class="list-tree-control ' . ($isOpen ? 'list-tree-control-open' : 'list-tree-control-closed') . '" href="' . htmlspecialchars($aUrl) . '"' . $name . '><i class="fa"></i></a>';
-        } else {
-            return $icon;
         }
+        return $icon;
     }
 
     /**
@@ -846,13 +844,13 @@ abstract class AbstractTreeView
         if (is_array($this->data)) {
             $res = $this->getDataInit($uid);
             return $this->getDataCount($res);
-        } else {
-            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->table);
-            $queryBuilder->getRestrictions()
+        }
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->table);
+        $queryBuilder->getRestrictions()
                 ->removeAll()
                 ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
                 ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
-            $count = $queryBuilder
+        $count = $queryBuilder
                 ->count('uid')
                 ->from($this->table)
                 ->where(
@@ -865,8 +863,7 @@ abstract class AbstractTreeView
                 ->execute()
                 ->fetchColumn();
 
-            return (int)$count;
-        }
+        return (int)$count;
     }
 
     /**
@@ -891,9 +888,8 @@ abstract class AbstractTreeView
     {
         if (is_array($this->data)) {
             return $this->dataLookup[$uid];
-        } else {
-            return BackendUtility::getRecordWSOL($this->table, $uid);
         }
+        return BackendUtility::getRecordWSOL($this->table, $uid);
     }
 
     /**
@@ -915,13 +911,13 @@ abstract class AbstractTreeView
                 reset($this->dataLookup[$parentId][$this->subLevelID]);
             }
             return $parentId;
-        } else {
-            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->table);
-            $queryBuilder->getRestrictions()
+        }
+        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->table);
+        $queryBuilder->getRestrictions()
                 ->removeAll()
                 ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
                 ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
-            $queryBuilder
+        $queryBuilder
                 ->select(...$this->fieldArray)
                 ->from($this->table)
                 ->where(
@@ -932,13 +928,12 @@ abstract class AbstractTreeView
                     QueryHelper::stripLogicalOperatorPrefix($this->clause)
                 );
 
-            foreach (QueryHelper::parseOrderBy($this->orderByFields) as $orderPair) {
-                list($fieldName, $order) = $orderPair;
-                $queryBuilder->addOrderBy($fieldName, $order);
-            }
-
-            return $queryBuilder->execute();
+        foreach (QueryHelper::parseOrderBy($this->orderByFields) as $orderPair) {
+            list($fieldName, $order) = $orderPair;
+            $queryBuilder->addOrderBy($fieldName, $order);
         }
+
+        return $queryBuilder->execute();
     }
 
     /**
@@ -953,9 +948,8 @@ abstract class AbstractTreeView
     {
         if (is_array($this->data)) {
             return count($this->dataLookup[$res][$this->subLevelID]);
-        } else {
-            return $res->rowCount();
         }
+        return $res->rowCount();
     }
 
     /**
@@ -976,15 +970,14 @@ abstract class AbstractTreeView
                 list(, $row) = each($this->dataLookup[$res][$this->subLevelID]);
             }
             return $row;
-        } else {
-            while ($row = $res->fetch()) {
-                BackendUtility::workspaceOL($this->table, $row, $this->BE_USER->workspace, true);
-                if (is_array($row)) {
-                    break;
-                }
+        }
+        while ($row = $res->fetch()) {
+            BackendUtility::workspaceOL($this->table, $row, $this->BE_USER->workspace, true);
+            if (is_array($row)) {
+                break;
             }
-            return $row;
         }
+        return $row;
     }
 
     /**
index 2c0f246..95b0ca8 100644 (file)
@@ -94,9 +94,8 @@ class ContentLayoutPagePositionMap extends PagePositionMap
             /** @var IconFactory $iconFactory */
             $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
             return $iconFactory->getIcon('status-status-current', Icon::SIZE_SMALL)->render() . $str;
-        } else {
-            return $str;
         }
+        return $str;
     }
 
     /**
index 37963cd..15392f6 100644 (file)
@@ -84,9 +84,8 @@ class ElementBrowserFolderTreeView extends FolderTreeView
         if ($this->ext_isLinkable($folderObject)) {
             $parameters = GeneralUtility::implodeArrayForUrl('', $this->linkParameterProvider->getUrlParameters(['identifier' => $folderObject->getCombinedIdentifier()]));
             return '<a href="#" onclick="return jumpToUrl(' . htmlspecialchars(GeneralUtility::quoteJSvalue($this->getThisScript() . ltrim($parameters, '&'))) . ');">' . $title . '</a>';
-        } else {
-            return '<span class="text-muted">' . $title . '</span>';
         }
+        return '<span class="text-muted">' . $title . '</span>';
     }
 
     /**
index dc6fe6f..ab6780b 100644 (file)
@@ -76,9 +76,8 @@ class ElementBrowserPageTreeView extends BrowseTreeView
         if ($this->ext_isLinkable($v['doktype'], $v['uid'])) {
             $url = GeneralUtility::makeInstance(LinkService::class)->asString(['type' => LinkService::TYPE_PAGE, 'pageuid' => (int)$v['uid']]);
             return '<span class="list-tree-title"><a href="' . htmlspecialchars($url) . '" class="t3js-pageLink">' . $title . '</a></span>';
-        } else {
-            return '<span class="list-tree-title text-muted">' . $title . '</span>';
         }
+        return '<span class="list-tree-title text-muted">' . $title . '</span>';
     }
 
     /**
index 9468de8..11f183b 100644 (file)
@@ -146,9 +146,8 @@ class FolderTreeView extends AbstractTreeView
             $scopeHash = GeneralUtility::hmac($scopeData);
             $js = htmlspecialchars('Tree.load(' . GeneralUtility::quoteJSvalue($cmd) . ', ' . (int)$isExpand . ', this, ' . GeneralUtility::quoteJSvalue($scopeData) . ', ' . GeneralUtility::quoteJSvalue($scopeHash) . ');');
             return '<a class="list-tree-control' . (!$isExpand ? ' list-tree-control-open' : ' list-tree-control-closed') . '" onclick="' . $js . '"><i class="fa"></i></a>';
-        } else {
-            return $icon;
         }
+        return $icon;
     }
 
     /**
@@ -644,12 +643,10 @@ class FolderTreeView extends AbstractTreeView
         if ($storageObject) {
             if ($startingPointFolder) {
                 return $this->storageHashNumbers[$storageObject->getUid() . $startingPointFolder->getCombinedIdentifier()];
-            } else {
-                return $this->storageHashNumbers[$storageObject->getUid()];
             }
-        } else {
-            return null;
+            return $this->storageHashNumbers[$storageObject->getUid()];
         }
+        return null;
     }
 
     /**
index 546afa0..c7fdfb3 100644 (file)
@@ -684,9 +684,8 @@ class BackendUtility
         }
         if ($fullTitleLimit) {
             return [$output, $fullOutput];
-        } else {
-            return $output;
         }
+        return $output;
     }
 
     /**
@@ -1245,74 +1244,74 @@ class BackendUtility
             && isset($pagesTSconfig_cacheReference[$id])
         ) {
             return $combinedTSconfig_cache[$pagesTSconfig_cacheReference[$id]];
+        }
+        $TSconfig = [];
+        if (!is_array($rootLine)) {
+            $useCacheForCurrentPageId = true;
+            $rootLine = self::BEgetRootLine($id, '', true);
         } else {
-            $TSconfig = [];
-            if (!is_array($rootLine)) {
-                $useCacheForCurrentPageId = true;
-                $rootLine = self::BEgetRootLine($id, '', true);
-            } else {
-                $useCacheForCurrentPageId = false;
-            }
-
-            // Order correctly
-            ksort($rootLine);
-            $TSdataArray = [];
-            // Setting default configuration
-            $TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];
-            foreach ($rootLine as $k => $v) {
-                if (trim($v['tsconfig_includes'])) {
-                    $includeTsConfigFileList = GeneralUtility::trimExplode(',', $v['tsconfig_includes'], true);
-                    // Traversing list
-                    foreach ($includeTsConfigFileList as $key => $includeTsConfigFile) {
-                        if (strpos($includeTsConfigFile, 'EXT:') === 0) {
-                            list($includeTsConfigFileExtensionKey, $includeTsConfigFilename) = explode(
+            $useCacheForCurrentPageId = false;
+        }
+
+        // Order correctly
+        ksort($rootLine);
+        $TSdataArray = [];
+        // Setting default configuration
+        $TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];
+        foreach ($rootLine as $k => $v) {
+            if (trim($v['tsconfig_includes'])) {
+                $includeTsConfigFileList = GeneralUtility::trimExplode(',', $v['tsconfig_includes'], true);
+                // Traversing list
+                foreach ($includeTsConfigFileList as $key => $includeTsConfigFile) {
+                    if (strpos($includeTsConfigFile, 'EXT:') === 0) {
+                        list($includeTsConfigFileExtensionKey, $includeTsConfigFilename) = explode(
                                 '/',
                                 substr($includeTsConfigFile, 4),
                                 2
                             );
-                            if ((string)$includeTsConfigFileExtensionKey !== ''
+                        if ((string)$includeTsConfigFileExtensionKey !== ''
                                 && ExtensionManagementUtility::isLoaded($includeTsConfigFileExtensionKey)
                                 && (string)$includeTsConfigFilename !== ''
                             ) {
-                                $includeTsConfigFileAndPath = ExtensionManagementUtility::extPath($includeTsConfigFileExtensionKey) .
+                            $includeTsConfigFileAndPath = ExtensionManagementUtility::extPath($includeTsConfigFileExtensionKey) .
                                     $includeTsConfigFilename;
-                                if (file_exists($includeTsConfigFileAndPath)) {
-                                    $TSdataArray['uid_' . $v['uid'] . '_static_' . $key] = file_get_contents($includeTsConfigFileAndPath);
-                                }
+                            if (file_exists($includeTsConfigFileAndPath)) {
+                                $TSdataArray['uid_' . $v['uid'] . '_static_' . $key] = file_get_contents($includeTsConfigFileAndPath);
                             }
                         }
                     }
                 }
-                $TSdataArray['uid_' . $v['uid']] = $v['TSconfig'];
-            }
-            $TSdataArray = static::emitGetPagesTSconfigPreIncludeSignal($TSdataArray, $id, $rootLine, $returnPartArray);
-            $TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray);
-            if ($returnPartArray) {
-                return $TSdataArray;
             }
-            // Parsing the page TS-Config
-            $pageTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
-            /* @var $parseObj \TYPO3\CMS\Backend\Configuration\TsConfigParser */
-            $parseObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TsConfigParser::class);
-            $res = $parseObj->parseTSconfig($pageTS, 'PAGES', $id, $rootLine);
-            if ($res) {
-                $TSconfig = $res['TSconfig'];
-            }
-            $cacheHash = $res['hash'];
-            // Get User TSconfig overlay
-            $userTSconfig = static::getBackendUserAuthentication()->userTS['page.'];
-            if (is_array($userTSconfig)) {
-                ArrayUtility::mergeRecursiveWithOverrule($TSconfig, $userTSconfig);
-                $cacheHash .= '_user' . $GLOBALS['BE_USER']->user['uid'];
-            }
-
-            if ($useCacheForCurrentPageId) {
-                if (!isset($combinedTSconfig_cache[$cacheHash])) {
-                    $combinedTSconfig_cache[$cacheHash] = $TSconfig;
-                }
-                $pagesTSconfig_cacheReference[$id] = $cacheHash;
+            $TSdataArray['uid_' . $v['uid']] = $v['TSconfig'];
+        }
+        $TSdataArray = static::emitGetPagesTSconfigPreIncludeSignal($TSdataArray, $id, $rootLine, $returnPartArray);
+        $TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray);
+        if ($returnPartArray) {
+            return $TSdataArray;
+        }
+        // Parsing the page TS-Config
+        $pageTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
+        /* @var $parseObj \TYPO3\CMS\Backend\Configuration\TsConfigParser */
+        $parseObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TsConfigParser::class);
+        $res = $parseObj->parseTSconfig($pageTS, 'PAGES', $id, $rootLine);
+        if ($res) {
+            $TSconfig = $res['TSconfig'];
+        }
+        $cacheHash = $res['hash'];
+        // Get User TSconfig overlay
+        $userTSconfig = static::getBackendUserAuthentication()->userTS['page.'];
+        if (is_array($userTSconfig)) {
+            ArrayUtility::mergeRecursiveWithOverrule($TSconfig, $userTSconfig);
+            $cacheHash .= '_user' . $GLOBALS['BE_USER']->user['uid'];
+        }
+
+        if ($useCacheForCurrentPageId) {
+            if (!isset($combinedTSconfig_cache[$cacheHash])) {
+                $combinedTSconfig_cache[$cacheHash] = $TSconfig;
             }
+            $pagesTSconfig_cacheReference[$id] = $cacheHash;
         }
+
         return $TSconfig;
     }
 
@@ -2679,9 +2678,8 @@ class BackendUtility
         }
         if ($fixed_lgd_chars) {
             return GeneralUtility::fixed_lgd_cs($l, $fixed_lgd_chars);
-        } else {
-            return $l;
         }
+        return $l;
     }
 
     /**
@@ -3662,9 +3660,8 @@ class BackendUtility
                 $beUser->pushModuleData($modName, $settings);
             }
             return $settings;
-        } else {
-            die('Wrong module name: "' . $modName . '"');
         }
+        die('Wrong module name: "' . $modName . '"');
     }
 
     /**
@@ -4285,9 +4282,8 @@ class BackendUtility
 
         if ($count) {
             return $msg ? sprintf($msg, $count) : $count;
-        } else {
-            return $msg ? '' : 0;
         }
+        return $msg ? '' : 0;
     }
 
     /**
@@ -4334,9 +4330,8 @@ class BackendUtility
 
         if ($count) {
             return $msg ? sprintf($msg, $count) : $count;
-        } else {
-            return $msg ? '' : 0;
         }
+        return $msg ? '' : 0;
     }
 
     /*******************************************
index ddcef7e..6b5d814 100644 (file)
@@ -200,7 +200,8 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface
                         // If layout for "next level" is set to "none" - don't use any and stop searching
                         $this->selectedCombinedIdentifier[$pageId] = false;
                         break;
-                    } elseif ($this->selectedCombinedIdentifier[$pageId] !== '' && $this->selectedCombinedIdentifier[$pageId] !== '0') {
+                    }
+                    if ($this->selectedCombinedIdentifier[$pageId] !== '' && $this->selectedCombinedIdentifier[$pageId] !== '0') {
                         // Stop searching if a layout for "next level" is set
                         break;
                     }
index dccf021..6709ba8 100644 (file)
@@ -248,9 +248,9 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
     {
         if (isset($this->externalTables[$table])) {
             return $this->getExternalTables($id, $table);
-        } else {
-            // Branch out based on table name:
-            switch ($table) {
+        }
+        // Branch out based on table name:
+        switch ($table) {
                 case 'pages':
                     return $this->getTable_pages($id);
                     break;
@@ -260,7 +260,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                 default:
                     return '';
             }
-        }
     }
 
     /**
@@ -1879,9 +1878,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         // Return values:
         if ($this->isDisabled('tt_content', $row)) {
             return '<span class="text-muted">' . $out . '</span>';
-        } else {
-            return $out;
         }
+        return $out;
     }
 
     /**
@@ -2067,9 +2065,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
             // Return link
             return '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($this->getLanguageService()->getLL('edit')) . '">' . $str . '</a>';
-        } else {
-            return $str;
         }
+        return $str;
     }
 
     /**
index e39ca1b..e68d887 100644 (file)
@@ -256,9 +256,8 @@ class PageTreeView extends BrowseTreeView
             // Activate dynamic ajax-based tree
             $js = htmlspecialchars('Tree.load(' . GeneralUtility::quoteJSvalue($cmd) . ', ' . (int)$isExpand . ', this);');
             return '<a class="list-tree-control' . (!$isExpand ? ' list-tree-control-open' : ' list-tree-control-closed') . '" onclick="' . $js . '"><i class="fa"></i></a>';
-        } else {
-            return $icon;
         }
+        return $icon;
     }
 
     /**
index c75633e..db58d08 100644 (file)
@@ -66,8 +66,7 @@ class ErrorIconViewHelper extends AbstractBackendViewHelper
         if ($errorSymbols[$arguments['errorNumber']]) {
             $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
             return $iconFactory->getIcon($errorSymbols[$arguments['errorNumber']], Icon::SIZE_SMALL)->render();
-        } else {
-            return '';
         }
+        return '';
     }
 }
index 4e3a211..6233bb9 100644 (file)
@@ -722,7 +722,8 @@ abstract class AbstractUserAuthentication
                         if ((int)$ret >= 200) {
                             $authenticated = true;
                             break;
-                        } elseif ((int)$ret >= 100) {
+                        }
+                        if ((int)$ret >= 100) {
                         } else {
                             $authenticated = true;
                         }
@@ -1177,14 +1178,13 @@ abstract class AbstractUserAuthentication
         $IP = GeneralUtility::getIndpEnv('REMOTE_ADDR');
         if ($parts >= 4) {
             return $IP;
-        } else {
-            $parts = MathUtility::forceIntegerInRange($parts, 1, 3);
-            $IPparts = explode('.', $IP);
-            for ($a = 4; $a > $parts; $a--) {
-                unset($IPparts[$a - 1]);
-            }
-            return implode('.', $IPparts);
         }
+        $parts = MathUtility::forceIntegerInRange($parts, 1, 3);
+        $IPparts = explode('.', $IP);
+        for ($a = 4; $a > $parts; $a--) {
+            unset($IPparts[$a - 1]);
+        }
+        return implode('.', $IPparts);
     }
 
     /**
index eb736d4..04ff453 100644 (file)
@@ -437,9 +437,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         }
         if (!$acs && $exitOnError) {
             throw new \RuntimeException('Access Error: You don\'t have access to this module.', 1294586448);
-        } else {
-            return $acs;
         }
+        return $acs;
     }
 
     /**
@@ -515,9 +514,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
                 }
             }
             return $constraint;
-        } else {
-            return ' 1=0';
         }
+        return ' 1=0';
     }
 
     /**
@@ -770,7 +768,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
                 if (!$this->checkLanguageAccess($idOrRow[$GLOBALS['TCA'][$table]['ctrl']['languageField']])) {
                     $this->errorMsg = 'ERROR: Language was not allowed.';
                     return false;
-                } elseif (
+                }
+                if (
                     $checkFullLanguageAccess && $idOrRow[$GLOBALS['TCA'][$table]['ctrl']['languageField']] == 0
                     && !$this->checkFullLanguagesAccess($table, $idOrRow)
                 ) {
@@ -916,36 +915,32 @@ class BackendUserAuthentication extends AbstractUserAuthentication
                     // No versioning, basic error, inconsistency even! Such records should not have a pid of -1!
                     if (!$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
                         return 'Versioning disabled for table';
-                    } elseif ((int)$recData['t3ver_wsid'] !== $this->workspace) {
+                    }
+                    if ((int)$recData['t3ver_wsid'] !== $this->workspace) {
                         // So does workspace match?
                         return 'Workspace ID of record didn\'t match current workspace';
-                    } else {
-                        // So is the user allowed to "use" the edit stage within the workspace?
-                        return $this->workspaceCheckStageForCurrent(0)
+                    }
+                    // So is the user allowed to "use" the edit stage within the workspace?
+                    return $this->workspaceCheckStageForCurrent(0)
                             ? false
                             : 'User\'s access level did not allow for editing';
-                    }
-                } else {
-                    // We are testing a "live" record:
-                    // For "Live" records, check that PID for table allows editing
-                    if ($res = $this->workspaceAllowLiveRecordsInPID($recData['pid'], $table)) {
-                        // Live records are OK in this branch, but what about the stage of branch point, if any:
-                        // OK
-                        return $res > 0
+                }
+                // We are testing a "live" record:
+                // For "Live" records, check that PID for table allows editing
+                if ($res = $this->workspaceAllowLiveRecordsInPID($recData['pid'], $table)) {
+                    // Live records are OK in this branch, but what about the stage of branch point, if any:
+                    // OK
+                    return $res > 0
                             ? false
                             : 'Stage for versioning root point and users access level did not allow for editing';
-                    } else {
-                        // If not offline and not in versionized branch, output error:
-                        return 'Online record was not in versionized branch!';
-                    }
                 }
-            } else {
-                return 'No record';
+                // If not offline and not in versionized branch, output error:
+                return 'Online record was not in versionized branch!';
             }
-        } else {
-            // OK because workspace is 0
-            return false;
+            return 'No record';
         }
+        // OK because workspace is 0
+        return false;
     }
 
     /**
@@ -965,15 +960,12 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             if (is_array($recData)) {
                 if ((int)$recData['pid'] === -1) {
                     return $this->workspaceCannotEditRecord($table, $recData);
-                } else {
-                    return 'Not an offline version';
                 }
-            } else {
-                return 'No record';
+                return 'Not an offline version';
             }
-        } else {
-            return 'Table does not support versioning.';
+            return 'No record';
         }
+        return 'Table does not support versioning.';
     }
 
     /**
@@ -998,10 +990,9 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         ) {
             // OK to create for this table.
             return 2;
-        } else {
-            // If the answer is FALSE it means the only valid way to create or edit records in the PID is by versioning
-            return false;
         }
+        // If the answer is FALSE it means the only valid way to create or edit records in the PID is by versioning
+        return false;
     }
 
     /**
@@ -1094,9 +1085,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             } elseif ($stage == -10 || $stage == -20) {
                 if ($stat['_ACCESS'] === 'owner') {
                     return true;
-                } else {
-                    return false;
                 }
+                return false;
             } else {
                 $memberStageLimit = $this->workspaceRec['review_stage_edit'] ? 1 : 0;
                 if (
@@ -1159,9 +1149,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
     {
         if ($this->workspace > 0 && (int)$this->workspaceRec['swap_modes'] === 2) {
             return false;
-        } else {
-            return true;
         }
+        return true;
     }
 
     /**
@@ -1962,9 +1951,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
 
         if ($uploadFolder instanceof \TYPO3\CMS\Core\Resource\Folder) {
             return $uploadFolder;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -2097,8 +2085,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         if (is_array($wsRec)) {
             if ($this->isAdmin()) {
                 return array_merge($wsRec, ['_ACCESS' => 'admin']);
-            } else {
-                switch ((string)$wsRec['uid']) {
+            }
+            switch ((string)$wsRec['uid']) {
                     case '0':
                         $retVal = $this->groupData['workspace_perms'] & Permission::PAGE_SHOW
                             ? array_merge($wsRec, ['_ACCESS' => 'online'])
@@ -2136,7 +2124,6 @@ class BackendUserAuthentication extends AbstractUserAuthentication
                             }
                         }
                 }
-            }
         }
         return $retVal;
     }
index dc6cfa2..508873c 100644 (file)
@@ -208,9 +208,8 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
         $identifiers = apc_fetch($this->getIdentifierPrefix() . 'tag_' . $tag, $success);
         if ($success === false) {
             return [];
-        } else {
-            return (array)$identifiers;
         }
+        return (array)$identifiers;
     }
 
     /**
index 3e550b1..b9eb0c0 100644 (file)
@@ -208,9 +208,8 @@ class ApcuBackend extends AbstractBackend implements TaggableBackendInterface
         $identifiers = apcu_fetch($this->getIdentifierPrefix() . 'tag_' . $tag, $success);
         if ($success === false) {
             return [];
-        } else {
-            return (array)$identifiers;
         }
+        return (array)$identifiers;
     }
 
     /**
index 534386c..2817219 100644 (file)
@@ -376,15 +376,13 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
         if ($this->frozen === true) {
             if (isset($this->cacheEntryIdentifiers[$entryIdentifier])) {
                 return require_once $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
-            } else {
-                return false;
-            }
-        } else {
-            if ($entryIdentifier !== basename($entryIdentifier)) {
-                throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1282073036);
             }
-            $pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
-            return $this->isCacheFileExpired($pathAndFilename) ? false : require_once $pathAndFilename;
+            return false;
         }
+        if ($entryIdentifier !== basename($entryIdentifier)) {
+            throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1282073036);
+        }
+        $pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
+        return $this->isCacheFileExpired($pathAndFilename) ? false : require_once $pathAndFilename;
     }
 }
index 1041fd0..dfbcab1 100644 (file)
@@ -348,9 +348,8 @@ class MemcachedBackend extends AbstractBackend implements TaggableBackendInterfa
         $identifiers = $this->memcache->get($this->identifierPrefix . 'tag_' . $tag);
         if ($identifiers !== false) {
             return (array)$identifiers;
-        } else {
-            return [];
         }
+        return [];
     }
 
     /**
index 6fc76bc..46fde70 100644 (file)
@@ -95,9 +95,8 @@ class TransientMemoryBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBacke
                 }
             }
             return true;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -112,9 +111,8 @@ class TransientMemoryBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBacke
     {
         if (isset($this->tagsAndEntries[$tag])) {
             return array_keys($this->tagsAndEntries[$tag]);
-        } else {
-            return [];
         }
+        return [];
     }
 
     /**
index b04eb2d..982d697 100644 (file)
@@ -139,9 +139,8 @@ class WincacheBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impl
         $identifiers = wincache_ucache_get($this->identifierPrefix . 'tag_' . $tag, $success);
         if ($success === false) {
             return [];
-        } else {
-            return (array)$identifiers;
         }
+        return (array)$identifiers;
     }
 
     /**
index 92c8ee7..bcb921d 100644 (file)
@@ -83,9 +83,8 @@ class VariableFrontend extends AbstractFrontend
         $rawResult = $this->backend->get($entryIdentifier);
         if ($rawResult === false) {
             return false;
-        } else {
-            return $this->backend instanceof TransientBackendInterface ? $rawResult : unserialize($rawResult);
         }
+        return $this->backend instanceof TransientBackendInterface ? $rawResult : unserialize($rawResult);
     }
 
     /**
index 01c4e9c..ce8ed1d 100644 (file)
@@ -773,12 +773,10 @@ class CharsetConverter implements SingletonInterface
                     }
                 }
                 return 2;
-            } else {
-                return false;
             }
-        } else {
-            return 1;
+            return false;
         }
+        return 1;
     }
 
     /**
@@ -997,10 +995,9 @@ class CharsetConverter implements SingletonInterface
                 $ord = hexdec($code_value);
                 if ($ord > 127) {
                     continue 2;
-                } else {
-                    // Skip decompositions containing non-ASCII chars
-                    $code_decomp[] = chr($ord);
                 }
+                // Skip decompositions containing non-ASCII chars
+                $code_decomp[] = chr($ord);
             }
             $ascii[$this->UnumberToChar(hexdec($from))] = implode('', $code_decomp);
         }
@@ -1377,13 +1374,11 @@ class CharsetConverter implements SingletonInterface
             // $len outside actual string length
             if ($byte_end === false) {
                 return $len < 0 ? '' : $str;
-            } else {
-                // When length is less than zero and exceeds, then we return blank string.
-                return substr($str, 0, $byte_end);
             }
-        } else {
-            return $str;
+            // When length is less than zero and exceeds, then we return blank string.
+            return substr($str, 0, $byte_end);
         }
+        return $str;
     }
 
     /**
@@ -1650,9 +1645,8 @@ class CharsetConverter implements SingletonInterface
         if ($i > $len) {
             // We ended on a first byte
             return substr($str, 0, $len - 1);
-        } else {
-            return substr($str, 0, $len);
         }
+        return substr($str, 0, $len);
     }
 
     /**
@@ -1679,12 +1673,10 @@ class CharsetConverter implements SingletonInterface
             // $len outside actual string length
             if ($byte_end === false) {
                 return $str;
-            } else {
-                return substr($str, 0, $byte_end);
             }
-        } else {
-            return $str;
+            return substr($str, 0, $byte_end);
         }
+        return $str;
     }
 
     /**
index 2e79e24..fe6a1c5 100644 (file)
@@ -168,30 +168,30 @@ class YamlFileLoader
         // Simple lists get merged / added up
         if (count(array_filter(array_keys($val1), 'is_int')) === count($val1)) {
             return array_merge($val1, $val2);
-        } else {
-            foreach ($val1 as $k => $v) {
-                // The key also exists in second array, if it is a simple value
-                // then $val2 will override the value, where an array is calling merge() recursively.
-                if (isset($val2[$k])) {
-                    if (is_array($v) && isset($val2[$k])) {
-                        if (is_array($val2[$k])) {
-                            $val1[$k] = $this->merge($v, $val2[$k]);
-                        } else {
-                            $val1[$k] = $val2[$k];
-                        }
+        }
+        foreach ($val1 as $k => $v) {
+            // The key also exists in second array, if it is a simple value
+            // then $val2 will override the value, where an array is calling merge() recursively.
+            if (isset($val2[$k])) {
+                if (is_array($v) && isset($val2[$k])) {
+                    if (is_array($val2[$k])) {
+                        $val1[$k] = $this->merge($v, $val2[$k]);
                     } else {
                         $val1[$k] = $val2[$k];
                     }
-                    unset($val2[$k]);
+                } else {
+                    $val1[$k] = $val2[$k];
                 }
+                unset($val2[$k]);
             }
-            // If there are properties in the second array left, they are added up
-            if (!empty($val2)) {
-                foreach ($val2 as $k => $v) {
-                    $val1[$k] = $v;
-                }
+        }
+        // If there are properties in the second array left, they are added up
+        if (!empty($val2)) {
+            foreach ($val2 as $k => $v) {
+                $val1[$k] = $v;
             }
         }
+
         return $val1;
     }
 }
index 3c5f214..1c67ec5 100644 (file)
@@ -584,9 +584,8 @@ abstract class AbstractConditionMatcher
         }
         if (!is_array($theVar) && !is_object($theVar)) {
             return $theVar;
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
index b8b5a78..c9970eb 100644 (file)
@@ -89,9 +89,8 @@ class FileDumpController
             $file->getStorage()->dumpFileContents($file);
             // @todo Refactor FAL to not echo directly, but to implement a stream for output here and use response
             return null;
-        } else {
-            return $response->withStatus(403);
         }
+        return $response->withStatus(403);
     }
 
     /**
index 49465e4..b1e97d9 100644 (file)
@@ -152,9 +152,8 @@ class ClassLoadingInformation
     {
         if (self::isTestingContext()) {
             return PATH_site . self::AUTOLOAD_INFO_DIR_TESTS;
-        } else {
-            return PATH_site . self::AUTOLOAD_INFO_DIR;
         }
+        return PATH_site . self::AUTOLOAD_INFO_DIR;
     }
 
     /**
index 051a912..e99bbd8 100644 (file)
@@ -5489,7 +5489,8 @@ class DataHandler
         } else {
             if ($pageIdsInBranch === -1) {
                 return 'Attempt to delete page without permissions';
-            } elseif ($pageIdsInBranch !== '') {
+            }
+            if ($pageIdsInBranch !== '') {
                 return 'Attempt to delete page which has subpages';
             }
 
@@ -5520,9 +5521,8 @@ class DataHandler
         if ($table === 'pages') {
             $res = $this->canDeletePage($id);
             return is_array($res) ? false : $res;
-        } else {
-            return $this->doesRecordExist($table, $id, 'delete') ? false : 'No permission to delete record';
         }
+        return $this->doesRecordExist($table, $id, 'delete') ? false : 'No permission to delete record';
     }
 
     /**
@@ -6516,14 +6516,15 @@ class DataHandler
         }
         if ($res === 1 || $res === 0) {
             return $res;
-        } else {
-            $res = 0;
         }
+        $res = 0;
+
         if ($GLOBALS['TCA'][$table] && (int)$id > 0) {
             // If information is cached, return it
             if (isset($this->recUpdateAccessCache[$table][$id])) {
                 return $this->recUpdateAccessCache[$table][$id];
-            } elseif ($this->doesRecordExist($table, $id, 'edit')) {
+            }
+            if ($this->doesRecordExist($table, $id, 'edit')) {
                 $res = 1;
             }
             // Cache the result
@@ -6779,9 +6780,8 @@ class DataHandler
                 BackendUtility::fixVersioningPid('pages', $row);
                 if ($row['pid'] == $id) {
                     return false;
-                } else {
-                    $destinationId = (int)$row['pid'];
                 }
+                $destinationId = (int)$row['pid'];
             } else {
                 return false;
             }
@@ -6991,9 +6991,8 @@ class DataHandler
                     }
                 }
                 return false;
-            } else {
-                return $this->doesRecordExist_pageLookUp($id, $perms, $columns);
             }
+            return $this->doesRecordExist_pageLookUp($id, $perms, $columns);
         }
         return false;
     }
@@ -7211,7 +7210,8 @@ class DataHandler
                         $this->registerRecordIdForPageCacheClearing($table, $id);
                     }
                     return $id;
-                } elseif ($this->enableLogging) {
+                }
+                if ($this->enableLogging) {
                     $this->log($table, $id, 1, 0, 2, 'SQL error: \'%s\' (%s)', 12, [$insertErrorMessage, $table . ':' . $id]);
                 }
             }
@@ -7371,19 +7371,17 @@ class DataHandler
                         $this->resorting($table, $pid, $sortRow, 0);
                         // First sorting number after resorting
                         return $this->sortIntervals;
-                    } else {
-                        // Sorting number between current top element and zero
-                        return floor($row[$sortRow] / 2);
                     }
-                } else {
-                    // No pages, so we choose the default value as sorting-number
-                    // First sorting number if no elements.
-                    return $this->sortIntervals;
+                    // Sorting number between current top element and zero
+                    return floor($row[$sortRow] / 2);
                 }
-            } else {
-                // Sorting number is inside the list
-                // Fetches the record which is supposed to be the prev record
-                $row = $queryBuilder
+                // No pages, so we choose the default value as sorting-number
+                // First sorting number if no elements.
+                return $this->sortIntervals;
+            }
+            // Sorting number is inside the list
+            // Fetches the record which is supposed to be the prev record
+            $row = $queryBuilder
                     ->where($queryBuilder->expr()->eq(
                         'uid',
                         $queryBuilder->createNamedParameter(abs($pid), \PDO::PARAM_INT)
@@ -7391,24 +7389,24 @@ class DataHandler
                     ->execute()
                     ->fetch();
 
-                // There was a record
-                if (!empty($row)) {
-                    // Look, if the record UID happens to be an offline record. If so, find its live version. Offline uids will be used when a page is versionized as "branch" so this is when we must correct - otherwise a pid of "-1" and a wrong sort-row number is returned which we don't want.
-                    if ($lookForLiveVersion = BackendUtility::getLiveVersionOfRecord($table, $row['uid'], $sortRow . ',pid,uid')) {
-                        $row = $lookForLiveVersion;
-                    }
-                    // Fetch move placeholder, since it might point to a new page in the current workspace
-                    if ($movePlaceholder = BackendUtility::getMovePlaceholder($table, $row['uid'], 'uid,pid,' . $sortRow)) {
-                        $row = $movePlaceholder;
-                    }
-                    // If the record should be inserted after itself, keep the current sorting information:
-                    if ((int)$row['uid'] === (int)$uid) {
-                        $sortNumber = $row[$sortRow];
-                    } else {
-                        $queryBuilder = $connectionPool->getQueryBuilderForTable($table);
-                        $this->addDeleteRestriction($queryBuilder->getRestrictions()->removeAll());
+            // There was a record
+            if (!empty($row)) {
+                // Look, if the record UID happens to be an offline record. If so, find its live version. Offline uids will be used when a page is versionized as "branch" so this is when we must correct - otherwise a pid of "-1" and a wrong sort-row number is returned which we don't want.
+                if ($lookForLiveVersion = BackendUtility::getLiveVersionOfRecord($table, $row['uid'], $sortRow . ',pid,uid')) {
+                    $row = $lookForLiveVersion;
+                }
+                // Fetch move placeholder, since it might point to a new page in the current workspace
+                if ($movePlaceholder = BackendUtility::getMovePlaceholder($table, $row['uid'], 'uid,pid,' . $sortRow)) {
+                    $row = $movePlaceholder;
+                }
+                // If the record should be inserted after itself, keep the current sorting information:
+                if ((int)$row['uid'] === (int)$uid) {
+                    $sortNumber = $row[$sortRow];
+                } else {
+                    $queryBuilder = $connectionPool->getQueryBuilderForTable($table);
+                    $this->addDeleteRestriction($queryBuilder->getRestrictions()->removeAll());
 
-                        $subResults = $queryBuilder
+                    $subResults = $queryBuilder
                             ->select($sortRow, 'pid', 'uid')
                             ->from($table)
                             ->where(
@@ -7425,34 +7423,32 @@ class DataHandler
                             ->setMaxResults(2)
                             ->execute()
                             ->fetchAll();
-                        // Fetches the next record in order to calculate the in-between sortNumber
-                        // There was a record afterwards
-                        if (count($subResults) === 2) {
-                            // There was a record afterwards, fetch that
-                            $subrow = array_pop($subResults);
-                            // The sortNumber is found in between these values
-                            $sortNumber = $row[$sortRow] + floor(($subrow[$sortRow] - $row[$sortRow]) / 2);
-                            // The sortNumber happened NOT to be between the two surrounding numbers, so we'll have to resort the list
-                            if ($sortNumber <= $row[$sortRow] || $sortNumber >= $subrow[$sortRow]) {
-                                // By this special param, resorting reserves and returns the sortnumber after the uid
-                                $sortNumber = $this->resorting($table, $row['pid'], $sortRow, $row['uid']);
-                            }
-                        } else {
-                            // If after the last record in the list, we just add the sortInterval to the last sortvalue
-                            $sortNumber = $row[$sortRow] + $this->sortIntervals;
+                    // Fetches the next record in order to calculate the in-between sortNumber
+                    // There was a record afterwards
+                    if (count($subResults) === 2) {
+                        // There was a record afterwards, fetch that
+                        $subrow = array_pop($subResults);
+                        // The sortNumber is found in between these values
+                        $sortNumber = $row[$sortRow] + floor(($subrow[$sortRow] - $row[$sortRow]) / 2);
+                        // The sortNumber happened NOT to be between the two surrounding numbers, so we'll have to resort the list
+                        if ($sortNumber <= $row[$sortRow] || $sortNumber >= $subrow[$sortRow]) {
+                            // By this special param, resorting reserves and returns the sortnumber after the uid
+                            $sortNumber = $this->resorting($table, $row['pid'], $sortRow, $row['uid']);
                         }
+                    } else {
+                        // If after the last record in the list, we just add the sortInterval to the last sortvalue
+                        $sortNumber = $row[$sortRow] + $this->sortIntervals;
                     }
-                    return ['pid' => $row['pid'], 'sortNumber' => $sortNumber];
-                } else {
-                    if ($this->enableLogging) {
-                        $propArr = $this->getRecordProperties($table, $uid);
-                        // OK, don't insert $propArr['event_pid'] here...
-                        $this->log($table, $uid, 4, 0, 1, 'Attempt to move record \'%s\' (%s) to after a non-existing record (uid=%s)', 1, [$propArr['header'], $table . ':' . $uid, abs($pid)], $propArr['pid']);
-                    }
-                    // There MUST be a page or else this cannot work
-                    return false;
                 }
+                return ['pid' => $row['pid'], 'sortNumber' => $sortNumber];
             }
+            if ($this->enableLogging) {
+                $propArr = $this->getRecordProperties($table, $uid);
+                // OK, don't insert $propArr['event_pid'] here...
+                $this->log($table, $uid, 4, 0, 1, 'Attempt to move record \'%s\' (%s) to after a non-existing record (uid=%s)', 1, [$propArr['header'], $table . ':' . $uid, abs($pid)], $propArr['pid']);
+            }
+            // There MUST be a page or else this cannot work
+            return false;
         }
         return null;
     }
@@ -7857,9 +7853,8 @@ class DataHandler
         // Returns the proper delete-clause if any for a table from TCA
         if (!$this->disableDeleteClause && $GLOBALS['TCA'][$table]['ctrl']['delete']) {
             return ' AND ' . $table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0';
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -8179,13 +8174,13 @@ class DataHandler
         if ($conf['foreign_field']) {
             // The reference to the parent is stored in a pointer field in the child record
             return 'field';
-        } elseif ($conf['MM']) {
+        }
+        if ($conf['MM']) {
             // Regular MM intermediate table is used to store data
             return 'mm';
-        } else {
-            // An item list (separated by comma) is stored (like select type is doing)
-            return 'list';
         }
+        // An item list (separated by comma) is stored (like select type is doing)
+        return 'list';
     }
 
     /**
@@ -8381,7 +8376,8 @@ class DataHandler
         // If the record was copied:
         if (isset($this->copyMappingArray[$table][$uid])) {
             return true;
-        } elseif (isset($this->copyMappingArray[$table]) && in_array($uid, array_values($this->copyMappingArray[$table]))) {
+        }
+        if (isset($this->copyMappingArray[$table]) && in_array($uid, array_values($this->copyMappingArray[$table]))) {
             return true;
         }
         return false;
index b1fea73..4cf0e7a 100644 (file)
@@ -434,13 +434,13 @@ class DataMapItem
     {
         if (MathUtility::canBeInterpretedAsInteger($idValue)) {
             return $idValue;
-        } elseif (strpos($idValue, 'NEW') === 0) {
+        }
+        if (strpos($idValue, 'NEW') === 0) {
             return $idValue;
-        } else {
-            // @todo Handle if $tableName does not match $this->tableName
-            list($tableName, $id) = BackendUtility::splitTable_Uid($idValue);
-            return $id;
         }
+        // @todo Handle if $tableName does not match $this->tableName
+        list($tableName, $id) = BackendUtility::splitTable_Uid($idValue);
+        return $id;
     }
 
     /**
index 448dc70..dbc16bd 100644 (file)
@@ -1156,7 +1156,8 @@ class DataMapProcessor
             && $element[$fieldNames['source']] !== $element[$fieldNames['parent']]
         ) {
             return (int)$fieldNames['source'];
-        } elseif (!empty($fieldNames['parent'])) {
+        }
+        if (!empty($fieldNames['parent'])) {
             // implicit: use parent pointer if defined
             return (int)$element[$fieldNames['parent']];
         }
index 9cc9016..3948cd4 100644 (file)
@@ -593,9 +593,8 @@ class DatabaseConnection
                 $this->debug_lastBuiltQuery = $query;
             }
             return $query;
-        } else {
-            throw new \InvalidArgumentException('TYPO3 Fatal Error: "Where" clause argument for UPDATE query was not a string in $this->UPDATEquery() !', 1270853880);
         }
+        throw new \InvalidArgumentException('TYPO3 Fatal Error: "Where" clause argument for UPDATE query was not a string in $this->UPDATEquery() !', 1270853880);
     }
 
     /**
@@ -620,9 +619,8 @@ class DatabaseConnection
                 $this->debug_lastBuiltQuery = $query;
             }
             return $query;
-        } else {
-            throw new \InvalidArgumentException('TYPO3 Fatal Error: "Where" clause argument for DELETE query was not a string in $this->DELETEquery() !', 1270853881);
         }
+        throw new \InvalidArgumentException('TYPO3 Fatal Error: "Where" clause argument for DELETE query was not a string in $this->DELETEquery() !', 1270853881);
     }
 
     /**
@@ -1112,9 +1110,8 @@ class DatabaseConnection
         $this->logDeprecation();
         if ($this->debug_check_recordset($res)) {
             return $res->num_rows;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -1134,9 +1131,8 @@ class DatabaseConnection
                 $result = false;
             }
             return $result;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -1157,9 +1153,8 @@ class DatabaseConnection
                 $result = false;
             }
             return $result;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -1175,9 +1170,8 @@ class DatabaseConnection
         if ($this->debug_check_recordset($res) && is_object($res)) {
             $res->free();
             return true;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -1213,9 +1207,8 @@ class DatabaseConnection
         $this->logDeprecation();
         if ($this->debug_check_recordset($res)) {
             return $res->data_seek($seek);
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -1256,9 +1249,8 @@ class DatabaseConnection
                 return false;
             }
             return $mysql_data_type_hash[$metaInfo->type];
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -1382,20 +1374,20 @@ class DatabaseConnection
                 'MySQL Error: Cannot get tablenames: "' . $this->sql_error() . '"!',
                 1378457171
             );
-        } else {
-            while ($row = $db_list->fetch_object()) {
-                try {
-                    $this->setDatabaseName($row->SCHEMA_NAME);
-                    if ($this->sql_select_db()) {
-                        $dbArr[] = $row->SCHEMA_NAME;
-                    }
-                } catch (\RuntimeException $exception) {
-                    // The exception happens if we cannot connect to the database
+        }
+        while ($row = $db_list->fetch_object()) {
+            try {
+                $this->setDatabaseName($row->SCHEMA_NAME);
+                if ($this->sql_select_db()) {
+                    $dbArr[] = $row->SCHEMA_NAME;
+                }
+            } catch (\RuntimeException $exception) {
+                // The exception happens if we cannot connect to the database
                     // (usually due to missing permissions). This is ok here.
                     // We catch the exception, skip the database and continue.
-                }
             }
         }
+
         return $dbArr;
     }
 
index bb18eb4..069a5a5 100644 (file)
@@ -76,11 +76,11 @@ class QueryHelper
 
                 if (!empty($as) && strtolower($as) === 'as' && !empty($alias)) {
                     return [$tableName, $alias];
-                } elseif (!empty($as) && empty($alias)) {
+                }
+                if (!empty($as) && empty($alias)) {
                     return [$tableName, $as];
-                } else {
-                    return [$tableName, null];
                 }
+                return [$tableName, null];
             },
             $tableExpressions
         );
index 6f115ef..39c5a68 100644 (file)
@@ -899,13 +899,15 @@ class ReferenceIndex
         // Get IRRE relations
         if (empty($conf)) {
             return false;
-        } elseif ($conf['type'] === 'inline' && !empty($conf['foreign_table']) && empty($conf['MM'])) {
+        }
+        if ($conf['type'] === 'inline' && !empty($conf['foreign_table']) && empty($conf['MM'])) {
             $dbAnalysis = GeneralUtility::makeInstance(RelationHandler::class);
             $dbAnalysis->setUseLiveReferenceIds(false);
             $dbAnalysis->start($value, $conf['foreign_table'], '', $uid, $table, $conf);
             return $dbAnalysis->itemArray;
             // DB record lists:
-        } elseif ($this->isDbReferenceField($conf)) {
+        }
+        if ($this->isDbReferenceField($conf)) {
             $allowedTables = $conf['type'] === 'group' ? $conf['allowed'] : $conf['foreign_table'];
             if ($conf['MM_opposite_field']) {
                 return [];
@@ -1042,21 +1044,20 @@ class ReferenceIndex
                     // Data Array, now ready to be sent to DataHandler
                     if ($returnDataArray) {
                         return $dataArray;
-                    } else {
-                        // Execute CMD array:
-                        $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
-                        $dataHandler->dontProcessTransformations = true;
-                        $dataHandler->bypassWorkspaceRestrictions = true;
-                        $dataHandler->bypassFileHandling = true;
-                        // Otherwise this cannot update things in deleted records...
-                        $dataHandler->bypassAccessCheckForRecords = true;
-                        // Check has been done previously that there is a backend user which is Admin and also in live workspace
-                        $dataHandler->start($dataArray, []);
-                        $dataHandler->process_datamap();
-                        // Return errors if any:
-                        if (!empty($dataHandler->errorLog)) {
-                            return LF . 'DataHandler:' . implode((LF . 'DataHandler:'), $dataHandler->errorLog);
-                        }
+                    }
+                    // Execute CMD array:
+                    $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
+                    $dataHandler->dontProcessTransformations = true;
+                    $dataHandler->bypassWorkspaceRestrictions = true;
+                    $dataHandler->bypassFileHandling = true;
+                    // Otherwise this cannot update things in deleted records...
+                    $dataHandler->bypassAccessCheckForRecords = true;
+                    // Check has been done previously that there is a backend user which is Admin and also in live workspace
+                    $dataHandler->start($dataArray, []);
+                    $dataHandler->process_datamap();
+                    // Return errors if any:
+                    if (!empty($dataHandler->errorLog)) {
+                        return LF . 'DataHandler:' . implode((LF . 'DataHandler:'), $dataHandler->errorLog);
                     }
                 }
             }
index 1221e47..226d81b 100644 (file)
@@ -155,15 +155,14 @@ class ConnectionMigrator
                 $this->getChangedFieldUpdateSuggestions($schemaDiff),
                 $this->getChangedTableOptions($schemaDiff)
             );
-        } else {
-            return array_merge_recursive(
+        }
+        return array_merge_recursive(
                 ['change' => [], 'change_table' => [], 'drop' => [], 'drop_table' => [], 'tables_count' => []],
                 $this->getUnusedFieldUpdateSuggestions($schemaDiff),
                 $this->getUnusedTableUpdateSuggestions($schemaDiff),
                 $this->getDropTableUpdateSuggestions($schemaDiff),
                 $this->getDropFieldUpdateSuggestions($schemaDiff)
             );
-        }
     }
 
     /**
@@ -1071,9 +1070,8 @@ class ConnectionMigrator
 
         if (is_string($nameLengthRestrictions)) {
             return $this->getTableAndFieldNameMaxLengths($nameLengthRestrictions);
-        } else {
-            return $nameLengthRestrictions;
         }
+        return $nameLengthRestrictions;
     }
 
     /**
index 21d7277..b110deb 100644 (file)
@@ -110,8 +110,8 @@ class ErrorHandler implements ErrorHandlerInterface
                 die($message);
             }
             throw new Exception($message, 1476107295);
-        } else {
-            switch ($errorLevel) {
+        }
+        switch ($errorLevel) {
                 case E_USER_ERROR:
                 case E_RECOVERABLE_ERROR:
                     $severity = 2;
@@ -123,52 +123,50 @@ class ErrorHandler implements ErrorHandlerInterface
                 default:
                     $severity = 0;
             }
-            $logTitle = 'Core: Error handler (' . TYPO3_MODE . ')';
-            $message = $logTitle . ': ' . $message;
-            // Write error message to the configured syslogs,
-            // see: $TYPO3_CONF_VARS['SYS']['systemLog']
-            if ($errorLevel & $GLOBALS['TYPO3_CONF_VARS']['SYS']['syslogErrorReporting']) {
-                GeneralUtility::sysLog($message, 'core', $severity + 1);
-            }
-            // Write error message to devlog extension(s),
-            GeneralUtility::devLog($message, 'core', $severity + 1);
+        $logTitle = 'Core: Error handler (' . TYPO3_MODE . ')';
+        $message = $logTitle . ': ' . $message;
+        // Write error message to the configured syslogs,
+        // see: $TYPO3_CONF_VARS['SYS']['systemLog']
+        if ($errorLevel & $GLOBALS['TYPO3_CONF_VARS']['SYS']['syslogErrorReporting']) {
+            GeneralUtility::sysLog($message, 'core', $severity + 1);
+        }
+        // Write error message to devlog extension(s),
+        GeneralUtility::devLog($message, 'core', $severity + 1);
 
-            // Write error message to TSlog (admin panel)
-            $timeTracker = $this->getTimeTracker();
-            if (is_object($timeTracker)) {
-                $timeTracker->setTSlogMessage($message, $severity + 1);
-            }
-            // Write error message to sys_log table (ext: belog, Tools->Log)
-            if ($errorLevel & $GLOBALS['TYPO3_CONF_VARS']['SYS']['belogErrorReporting']) {
-                // Silently catch in case an error occurs before a database connection exists,
-                // but DatabaseConnection fails to connect.
-                try {
-                    $this->writeLog($message, $severity);
-                } catch (\Exception $e) {
-                }
+        // Write error message to TSlog (admin panel)
+        $timeTracker = $this->getTimeTracker();
+        if (is_object($timeTracker)) {
+            $timeTracker->setTSlogMessage($message, $severity + 1);
+        }
+        // Write error message to sys_log table (ext: belog, Tools->Log)
+        if ($errorLevel & $GLOBALS['TYPO3_CONF_VARS']['SYS']['belogErrorReporting']) {
+            // Silently catch in case an error occurs before a database connection exists,
+            // but DatabaseConnection fails to connect.
+            try {
+                $this->writeLog($message, $severity);
+            } catch (\Exception $e) {
             }
-            if ($severity === 2) {
-                // Let the internal handler continue. This will stop the script
-                return false;
-            } else {
-                if ($this->debugMode) {
-                    /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
-                    $flashMessage = GeneralUtility::makeInstance(
+        }
+        if ($severity === 2) {
+            // Let the internal handler continue. This will stop the script
+            return false;
+        }
+        if ($this->debugMode) {
+            /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
+            $flashMessage = GeneralUtility::makeInstance(
                         \TYPO3\CMS\Core\Messaging\FlashMessage::class,
                         $message,
                         'PHP ' . $errorLevels[$errorLevel],
                         $severity
                     );
-                    /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
-                    $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
-                    /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
-                    $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
-                    $defaultFlashMessageQueue->enqueue($flashMessage);
-                }
-                // Don't execute PHP internal error handler
-                return true;
-            }
+            /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+            $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
+            /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+            $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+            $defaultFlashMessageQueue->enqueue($flashMessage);
         }
+        // Don't execute PHP internal error handler
+        return true;
     }
 
     /**
index 023ca88..3b3522d 100644 (file)
@@ -115,9 +115,8 @@ class ProductionExceptionHandler extends AbstractExceptionHandler
     {
         if ($this->discloseExceptionInformation($exception) && method_exists($exception, 'getTitle') && $exception->getTitle() !== '') {
             return $exception->getTitle();
-        } else {
-            return $this->defaultTitle;
         }
+        return $this->defaultTitle;
     }
 
     /**
@@ -130,8 +129,7 @@ class ProductionExceptionHandler extends AbstractExceptionHandler
     {
         if ($this->discloseExceptionInformation($exception)) {
             return $exception->getMessage();
-        } else {
-            return $this->defaultMessage;
         }
+        return $this->defaultMessage;
     }
 }
index 14c481a..6557c67 100644 (file)
@@ -78,10 +78,9 @@ class ExtDirectApi
                                }
                                Ext.apply(Ext.app.ExtDirectAPI, ' . json_encode($javascriptNamespaces) . ');
                        ';
-        } else {
-            $errorMessage = $this->getNamespaceError($filterNamespaces);
-            throw new \InvalidArgumentException($errorMessage, 1297645190);
         }
+        $errorMessage = $this->getNamespaceError($filterNamespaces);
+        throw new \InvalidArgumentException($errorMessage, 1297645190);
     }
 
     /**
index 1d114b4..02bee07 100644 (file)
@@ -151,9 +151,8 @@ class Message implements MessageInterface
         $headerValue = $this->headers[$header];
         if (is_array($headerValue)) {
             return $headerValue;
-        } else {
-            return [$headerValue];
         }
+        return [$headerValue];
     }
 
     /**
index 9036120..a1dda68 100644 (file)
@@ -356,10 +356,9 @@ class ServerRequest extends Request implements ServerRequestInterface
         $clonedObject = clone $this;
         if (!isset($clonedObject->attributes[$name])) {
             return $clonedObject;
-        } else {
-            unset($clonedObject->attributes[$name]);
-            return $clonedObject;
         }
+        unset($clonedObject->attributes[$name]);
+        return $clonedObject;
     }
 
     /**
index ecef077..7b7e9e6 100644 (file)
@@ -157,7 +157,8 @@ class ServerRequestFactory
                 }
             }
             return $files;
-        } elseif (!empty($value['tmp_name'])) {
+        }
+        if (!empty($value['tmp_name'])) {
             return new UploadedFile($value['tmp_name'], $value['size'], $value['error'], $value['name'], $value['type']);
         }
         return null;
index 85e6160..b74e9c9 100644 (file)
@@ -936,25 +936,23 @@ class GraphicalFunctions
             // If any kind of spacing applys, we use this function:
             if ($spacing || $wordSpacing) {
                 return $conf['fontSize'];
-            } else {
-                do {
-                    // Determine bounding box.
-                    $bounds = $this->ImageTTFBBoxWrapper($conf['fontSize'], $conf['angle'], $conf['fontFile'], $conf['text'], $conf['splitRendering.']);
-                    if ($conf['angle'] < 0) {
-                        $pixelWidth = abs($bounds[4] - $bounds[0]);
-                    } elseif ($conf['angle'] > 0) {
-                        $pixelWidth = abs($bounds[2] - $bounds[6]);
-                    } else {
-                        $pixelWidth = abs($bounds[4] - $bounds[6]);
-                    }
-                    // Size is fine, exit:
-                    if ($pixelWidth <= $maxWidth) {
-                        break;
-                    } else {
-                        $conf['fontSize']--;
-                    }
-                } while ($conf['fontSize'] > 1);
             }
+            do {
+                // Determine bounding box.
+                $bounds = $this->ImageTTFBBoxWrapper($conf['fontSize'], $conf['angle'], $conf['fontFile'], $conf['text'], $conf['splitRendering.']);
+                if ($conf['angle'] < 0) {
+                    $pixelWidth = abs($bounds[4] - $bounds[0]);
+                } elseif ($conf['angle'] > 0) {
+                    $pixelWidth = abs($bounds[2] - $bounds[6]);
+                } else {
+                    $pixelWidth = abs($bounds[4] - $bounds[6]);
+                }
+                // Size is fine, exit:
+                if ($pixelWidth <= $maxWidth) {
+                    break;
+                }
+                $conf['fontSize']--;
+            } while ($conf['fontSize'] > 1);
         }
         return $conf['fontSize'];
     }
@@ -2227,16 +2225,15 @@ class GraphicalFunctions
         if (file_exists($imageFile) && GeneralUtility::inList($this->imageFileExt, strtolower($reg[0]))) {
             if ($returnArr = $this->getCachedImageDimensions($imageFile)) {
                 return $returnArr;
+            }
+            if ($temp = @getimagesize($imageFile)) {
+                $returnArr = [$temp[0], $temp[1], strtolower($reg[0]), $imageFile];
             } else {
-                if ($temp = @getimagesize($imageFile)) {
-                    $returnArr = [$temp[0], $temp[1], strtolower($reg[0]), $imageFile];
-                } else {
-                    $returnArr = $this->imageMagickIdentify($imageFile);
-                }
-                if ($returnArr) {
-                    $this->cacheImageDimensions($returnArr);
-                    return $returnArr;
-                }
+                $returnArr = $this->imageMagickIdentify($imageFile);
+            }
+            if ($returnArr) {
+                $this->cacheImageDimensions($returnArr);
+                return $returnArr;
             }
         }
         return null;
@@ -2714,9 +2711,8 @@ class GraphicalFunctions
     {
         if ($type === 'ai' || $w * $h < $this->pixelLimitGif) {
             return $this->gifExtension;
-        } else {
-            return 'jpg';
         }
+        return 'jpg';
     }
 
     /**
index 6ed4855..aff1f81 100644 (file)
@@ -3473,8 +3473,7 @@ class IconRegistry implements SingletonInterface
     {
         if (StringUtility::endsWith(strtolower($iconReference), 'svg')) {
             return SvgIconProvider::class;
-        } else {
-            return BitmapIconProvider::class;
         }
+        return BitmapIconProvider::class;
     }
 }
index 7b96db8..df6e16c 100644 (file)
@@ -179,8 +179,7 @@ class Area
     {
         if ($this->isEmpty()) {
             return '';
-        } else {
-            return json_encode($this->asArray());
         }
+        return json_encode($this->asArray());
     }
 }
index 949dde5..10a3cf9 100644 (file)
@@ -129,9 +129,8 @@ class CropVariantCollection
     {
         if (isset($this->cropVariants[$id])) {
             return $this->cropVariants[$id]->getCropArea();
-        } else {
-            return Area::createEmpty();
         }
+        return Area::createEmpty();
     }
 
     /**
@@ -142,9 +141,8 @@ class CropVariantCollection
     {
         if (isset($this->cropVariants[$id]) && $this->cropVariants[$id]->getFocusArea() !== null) {
             return $this->cropVariants[$id]->getFocusArea();
-        } else {
-            return Area::createEmpty();
         }
+        return Area::createEmpty();
     }
 
     /**
index 890fd7c..d61ceed 100644 (file)
@@ -276,9 +276,8 @@ class DatabaseIntegrityCheck
                 ->getConnectionForTable($table)
                 ->update($table, $updateFields, ['uid' => (int)$uid]);
             return true;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
index 5a525e0..4c67cff 100644 (file)
@@ -146,7 +146,8 @@ class LinkService implements SingletonInterface
     {
         if (is_object($this->handlers[$parameters['type']])) {
             return $this->handlers[$parameters['type']]->asString($parameters);
-        } elseif (isset($parameters['url']) && !empty($parameters['url'])) {
+        }
+        if (isset($parameters['url']) && !empty($parameters['url'])) {
             // This usually happens for tel: or other types where a URL is available and the
             // legacy link service could resolve at least something
             return $parameters['url'];
index 97abc47..dc20d5a 100644 (file)
@@ -201,9 +201,8 @@ class LanguageStore implements \TYPO3\CMS\Core\SingletonInterface
     {
         if (isset($this->configuration[$fileReference]['parserClass']) && trim($this->configuration[$fileReference]['parserClass']) !== '') {
             return GeneralUtility::makeInstance((string)$this->configuration[$fileReference]['parserClass']);
-        } else {
-            throw new InvalidParserException(sprintf('Invalid parser configuration for the current file (%s)', $fileReference), 1307293692);
         }
+        throw new InvalidParserException(sprintf('Invalid parser configuration for the current file (%s)', $fileReference), 1307293692);
     }
 
     /**
@@ -217,9 +216,8 @@ class LanguageStore implements \TYPO3\CMS\Core\SingletonInterface
     {
         if (isset($this->configuration[$fileReference]['fileReference']) && trim($this->configuration[$fileReference]['fileReference']) !== '') {
             return (string)$this->configuration[$fileReference]['fileReference'];
-        } else {
-            throw new \InvalidArgumentException(sprintf('Invalid file reference configuration for the current file (%s)', $fileReference), 1307293693);
         }
+        throw new \InvalidArgumentException(sprintf('Invalid file reference configuration for the current file (%s)', $fileReference), 1307293693);
     }
 
     /**
index 56d7788..ae3d9be 100644 (file)
@@ -255,11 +255,11 @@ class Rfc822AddressesParser
         if ($is_group && $address[0] === ',') {
             $address = trim(substr($address, 1));
             return $address;
-        } elseif ($address !== '') {
+        }
+        if ($address !== '') {
             return $address;
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -280,9 +280,8 @@ class Rfc822AddressesParser
         if (count(($parts = explode(':', $string))) > 1) {
             $string2 = $this->_splitCheck($parts, ':');
             return $string2 !== $string;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
@@ -361,9 +360,8 @@ class Rfc822AddressesParser
         if ($num_angle_start < $num_angle_end) {
             $this->error = 'Invalid address spec. Unmatched quote or bracket (' . $chars . ')';
             return false;
-        } else {
-            return $num_angle_start > $num_angle_end;
         }
+        return $num_angle_start > $num_angle_end;
     }
 
     /**
index 093819d..e5def1f 100644 (file)
@@ -1843,7 +1843,8 @@ class TcaMigration
                                     . $table . '[\'columns\'][\'' . $fieldName . '\'] has been dropped, the setting'
                                     . ' is no longer supported';
                                 continue;
-                            } elseif ($defaultExtrasSetting === 'nowrap') {
+                            }
+                            if ($defaultExtrasSetting === 'nowrap') {
                                 $fieldConfig['config']['wrap'] = 'off';
                                 $this->messages[] = 'The defaultExtras setting \'nowrap\' in TCA table '
                                     . $table . '[\'columns\'][\'' . $fieldName . '\'] has been migrated to TCA table '
@@ -1881,7 +1882,8 @@ class TcaMigration
                                         . $table . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'' . $fieldName . '\']'
                                         . ' has been dropped, the setting is no longer supported';
                                     continue;
-                                } elseif ($defaultExtrasSetting === 'nowrap') {
+                                }
+                                if ($defaultExtrasSetting === 'nowrap') {
                                     $overrideConfig['config']['wrap'] = 'off';
                                     $this->messages[] = 'The defaultExtras setting \'nowrap\' in TCA table '
                                         . $table . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'' . $fieldName . '\']'
index ef22e66..1b37fa3 100644 (file)
@@ -482,9 +482,8 @@ class PackageManager implements \TYPO3\CMS\Core\SingletonInterface
         $lowercasedComposerName = strtolower($composerName);
         if (isset($this->composerNameToPackageKeyMap[$lowercasedComposerName])) {
             return $this->composerNameToPackageKeyMap[$lowercasedComposerName];
-        } else {
-            return $composerName;
         }
+        return $composerName;
     }
 
     /**
@@ -1023,10 +1022,9 @@ class PackageManager implements \TYPO3\CMS\Core\SingletonInterface
         if (isset($manifest->type) && substr($manifest->type, 0, 10) === 'typo3-cms-') {
             $packageKey = basename($packagePath);
             return preg_replace('/[^A-Za-z0-9._-]/', '', $packageKey);
-        } else {
-            $packageKey = str_replace('/', '.', $manifest->name);
-            return preg_replace('/[^A-Za-z0-9.]/', '', $packageKey);
         }
+        $packageKey = str_replace('/', '.', $manifest->name);
+        return preg_replace('/[^A-Za-z0-9.]/', '', $packageKey);
     }
 
     /**
index 48694b5..4145b75 100644 (file)
@@ -122,9 +122,8 @@ abstract class AbstractFile implements FileInterface
     {
         if ($this->hasProperty($key)) {
             return $this->properties[$key];
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
@@ -537,9 +536,8 @@ abstract class AbstractFile implements FileInterface
     {
         if ($this->deleted) {
             return null;
-        } else {
-            return $this->getStorage()->getPublicUrl($this, $relativeToCurrentScript);
         }
+        return $this->getStorage()->getPublicUrl($this, $relativeToCurrentScript);
     }
 
     /**
index 3b06105..9dd7a97 100644 (file)
@@ -65,7 +65,8 @@ class FileCollectionRegistry implements SingletonInterface
             // Return immediately without changing configuration
             if ($this->types[$type] === $className) {
                 return true;
-            } elseif (!$override) {
+            }
+            if (!$override) {
                 throw new \InvalidArgumentException('FileCollections ' . $type . ' is already registered.', 1391295643);
             }
         }
index 2f77ecb..9fd1da0 100644 (file)
@@ -68,9 +68,8 @@ class DriverRegistry implements \TYPO3\CMS\Core\SingletonInterface
             // Return immediately without changing configuration
             if ($this->drivers[$shortName] === $className) {
                 return true;
-            } else {
-                throw new \InvalidArgumentException('Driver ' . $shortName . ' is already registered.', 1314979451);
             }
+            throw new \InvalidArgumentException('Driver ' . $shortName . ' is already registered.', 1314979451);
         }
         $this->drivers[$shortName] = $className;
         $this->driverConfigurations[$shortName] = [
index b453616..56b0654 100644 (file)
@@ -410,7 +410,8 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
                 // If calling the method succeeded and thus we can't use that as a return value.
                 if ($result === -1) {
                     return false;
-                } elseif ($result === false) {
+                }
+                if ($result === false) {
                     throw new \RuntimeException(
                         'Could not apply file/folder name filter ' . $filter[0] . '::' . $filter[1],
                         1476046425
@@ -1239,9 +1240,8 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
     {
         if ($writable === false) {
             return $this->getAbsolutePath($fileIdentifier);
-        } else {
-            return $this->copyFileToTemporaryPath($fileIdentifier);
         }
+        return $this->copyFileToTemporaryPath($fileIdentifier);
     }
 
     /**
@@ -1413,11 +1413,11 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
             $recycleDirectory = $searchDirectory . '/' . $recyclerSubdirectory;
             if (is_dir($recycleDirectory)) {
                 return $recycleDirectory;
-            } elseif ($searchDirectory === $rootDirectory) {
+            }
+            if ($searchDirectory === $rootDirectory) {
                 return '';
-            } else {
-                $searchDirectory = PathUtility::dirname($searchDirectory);
             }
+            $searchDirectory = PathUtility::dirname($searchDirectory);
         }
 
         return '';
index c6339be..3af1e4d 100644 (file)
@@ -79,10 +79,9 @@ class File extends AbstractFile
     {
         if (parent::hasProperty($key)) {
             return parent::getProperty($key);
-        } else {
-            $metaData = $this->_getMetaData();
-            return isset($metaData[$key]) ? $metaData[$key] : null;
         }
+        $metaData = $this->_getMetaData();
+        return isset($metaData[$key]) ? $metaData[$key] : null;
     }
 
     /**
@@ -366,9 +365,8 @@ class File extends AbstractFile
     {
         if ($this->isMissing() || $this->deleted) {
             return false;
-        } else {
-            return $this->getStorage()->getPublicUrl($this, $relativeToCurrentScript);
         }
+        return $this->getStorage()->getPublicUrl($this, $relativeToCurrentScript);
     }
 
     /**
index ada1f77..54ad856 100644 (file)
@@ -46,9 +46,8 @@ class FileNameFilter
         // Only apply the filter if you want to hide the hidden files
         if (self::$showHiddenFilesAndFolders === false && strpos($itemIdentifier, '/.') !== false) {
             return -1;
-        } else {
-            return true;
         }
+        return true;
     }
 
     /**
index 4bff351..41ea48e 100644 (file)
@@ -55,11 +55,11 @@ class ExtractorRegistry implements SingletonInterface
     {
         if (!class_exists($className)) {
             throw new \InvalidArgumentException('The class "' . $className . '" you are registering is not available', 1422705270);
-        } elseif (!in_array(ExtractorInterface::class, class_implements($className))) {
+        }
+        if (!in_array(ExtractorInterface::class, class_implements($className))) {
             throw new \InvalidArgumentException('The extractor needs to implement the ExtractorInterface', 1422705271);
-        } else {
-            $this->extractors[] = $className;
         }
+        $this->extractors[] = $className;
     }
 
     /**
index 4ab9c7a..b5238fa 100644 (file)
@@ -316,9 +316,8 @@ class ProcessedFile extends AbstractFile
     {
         if ($this->usesOriginalFile()) {
             return $this->originalFile->getName();
-        } else {
-            return $this->name;
         }
+        return $this->name;
     }
 
     /**
@@ -434,9 +433,8 @@ class ProcessedFile extends AbstractFile
         // Only delete file when original isn't used
         if (!$this->usesOriginalFile()) {
             return parent::delete();
-        } else {
-            return true;
         }
+        return true;
     }
 
     /**
@@ -451,9 +449,8 @@ class ProcessedFile extends AbstractFile
         // The uid always (!) has to come from this file and never the original file (see getOriginalFile() to get this)
         if ($this->isUnchanged() && $key !== 'uid') {
             return $this->originalFile->getProperty($key);
-        } else {
-            return $this->properties[$key];
         }
+        return $this->properties[$key];
     }
 
     /**
@@ -565,10 +562,10 @@ class ProcessedFile extends AbstractFile
     {
         if ($this->deleted) {
             return null;
-        } elseif ($this->usesOriginalFile()) {
+        }
+        if ($this->usesOriginalFile()) {
             return $this->getOriginalFile()->getPublicUrl($relativeToCurrentScript);
-        } else {
-            return $this->getStorage()->getPublicUrl($this, $relativeToCurrentScript);
         }
+        return $this->getStorage()->getPublicUrl($this, $relativeToCurrentScript);
     }
 }
index 2798fb8..465903d 100644 (file)
@@ -128,9 +128,8 @@ class LocalImageProcessor implements ProcessorInterface
             $task->getTargetFile()->updateProperties($properties);
 
             return true;
-        } else {
-            return false;
         }
+        return false;
     }
 
     /**
index 6186508..de5f976 100644 (file)
@@ -56,11 +56,11 @@ class RendererRegistry implements \TYPO3\CMS\Core\SingletonInterface
     {
         if (!class_exists($className)) {
             throw new \InvalidArgumentException('The class "' . $className . '" you are trying to register is not available', 1411840171);
-        } elseif (!in_array(FileRendererInterface::class, class_implements($className), true)) {
+        }
+        if (!in_array(FileRendererInterface::class, class_implements($className), true)) {
             throw new \InvalidArgumentException('The renderer needs to implement the FileRendererInterface', 1411840172);
-        } else {
-            $this->classNames[] = $className;
         }
+        $this->classNames[] = $className;
     }
 
     /**
index e4162db..8c97941 100644 (file)
@@ -470,14 +470,17 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl
         if (GeneralUtility::isFirstPartOfStr($input, 'file:')) {
             $input = substr($input, 5);
             return $this->retrieveFileOrFolderObject($input);
-        } elseif (MathUtility::canBeInterpretedAsInteger($input)) {
+        }
+        if (MathUtility::canBeInterpretedAsInteger($input)) {
             return $this->getFileObject($input);
-        } elseif (strpos($input, ':') > 0) {
+        }
+        if (strpos($input, ':') > 0) {
             list($prefix) = explode(':', $input);
             if (MathUtility::canBeInterpretedAsInteger($prefix)) {
                 // path or folder in a valid storageUID
                 return $this->getObjectFromCombinedIdentifier($input);
-            } elseif ($prefix === 'EXT') {
+            }
+            if ($prefix === 'EXT') {
                 $input = GeneralUtility::getFileAbsFileName($input);
                 if (empty($input)) {
                     return null;
@@ -485,21 +488,18 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl
 
                 $input = PathUtility::getRelativePath(PATH_site, PathUtility::dirname($input)) . PathUtility::basename($input);
                 return $this->getFileObjectFromCombinedIdentifier($input);
-            } else {
-                return null;
-            }
-        } else {
-            // this is a backwards-compatible way to access "0-storage" files or folders
-            // eliminate double slashes, /./ and /../
-            $input = PathUtility::getCanonicalPath(ltrim($input, '/'));
-            if (@is_file(PATH_site . $input)) {
-                // only the local file
-                return $this->getFileObjectFromCombinedIdentifier($input);
-            } else {
-                // only the local path
-                return $this->getFolderObjectFromCombinedIdentifier($input);
             }
+            return null;
+        }
+        // this is a backwards-compatible way to access "0-storage" files or folders
+        // eliminate double slashes, /./ and /../
+        $input = PathUtility::getCanonicalPath(ltrim($input, '/'));
+        if (@is_file(PATH_site . $input)) {
+            // only the local file
+            return $this->getFileObjectFromCombinedIdentifier($input);
         }
+        // only the local path
+        return $this->getFolderObjectFromCombinedIdentifier($input);
     }
 
     /**
@@ -558,11 +558,11 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl
         $storage = $this->getStorageObject($storageId);
         if ($storage->hasFile($objectIdentifier)) {
             return $storage->getFile($objectIdentifier);
-        } elseif ($storage->hasFolder($objectIdentifier)) {
+        }
+        if ($storage->hasFolder($objectIdentifier)) {
             return $storage->getFolder($objectIdentifier);
-        } else {
-            throw new Exception\ResourceDoesNotExistException('Object with identifier "' . $identifier . '" does not exist in storage', 1329647780);
         }
+        throw new Exception\ResourceDoesNotExistException('Object with identifier "' . $identifier . '" does not exist in storage', 1329647780);
     }
 
     /**
index 131e747..38d4a46 100644 (file)
@@ -521,7 +521,8 @@ class ResourceStorage implements ResourceStorageInterface
                     $isWithinFileMount = true;
                     if (!$checkWriteAccess) {
                         break;
-                    } elseif (empty($fileMount['read_only'])) {
+                    }
+                    if (empty($fileMount['read_only'])) {
                         $writableFileMountAvailable = true;
                         break;
                     }
@@ -734,15 +735,14 @@ class ResourceStorage implements ResourceStorageInterface
                 }
                 // If no match we return TRUE
                 return true;
-            } else {
-                if ($fileExtensionPermissions['allow'] === '*') {
-                    return true;
-                }
-                if ($fileExtensionPermissions['deny'] === '*') {
-                    return false;
-                }
+            }
+            if ($fileExtensionPermissions['allow'] === '*') {
                 return true;
             }
+            if ($fileExtensionPermissions['deny'] === '*') {
+                return false;
+            }
+            return true;
         }
         return $isAllowed;
     }
@@ -761,12 +761,11 @@ class ResourceStorage implements ResourceStorageInterface
                     'You are not allowed to read folders',
                     1430657869
                 );
-            } else {
-                throw new Exception\InsufficientFolderAccessPermissionsException(
+            }
+            throw new Exception\InsufficientFolderAccessPermissionsException(
                     'You are not allowed to access the given folder: "' . $folder->getName() . '"',
                     1375955684
                 );
-            }
         }
     }
 
@@ -1170,7 +1169,8 @@ class ResourceStorage implements ResourceStorageInterface
         $replaceExisting = false;
         if ($conflictMode->equals(DuplicationBehavior::CANCEL) && $this->driver->fileExistsInFolder($targetFileName, $targetFolder->getIdentifier())) {
             throw new Exception\ExistingTargetFileNameException('File "' . $targetFileName . '" already exists in folder ' . $targetFolder->getIdentifier(), 1322121068);
-        } elseif ($conflictMode->equals(DuplicationBehavior::RENAME)) {
+        }
+        if ($conflictMode->equals(DuplicationBehavior::RENAME)) {
             $targetFileName = $this->getUniqueName($targetFolder, $targetFileName);
         } elseif ($conflictMode->equals(DuplicationBehavior::REPLACE) && $this->driver->fileExistsInFolder($targetFileName, $targetFolder->getIdentifier())) {
             $replaceExisting = true;
@@ -2405,9 +2405,8 @@ class ResourceStorage implements ResourceStorageInterface
         if ($respectFileMounts && !empty($this->fileMounts)) {
             $mount = reset($this->fileMounts);
             return $mount['folder'];
-        } else {
-            return $this->getResourceFactoryInstance()->createFolderObject($this, $this->driver->getRootLevelFolder(), '');
         }
+        return $this->getResourceFactoryInstance()->createFolderObject($this, $this->driver->getRootLevelFolder(), '');
     }
 
     /**
index df5de9c..a98f7f2 100644 (file)
@@ -240,12 +240,11 @@ class DependencyOrderingService
         foreach (array_filter($graph[$from]) as $node => $_) {
             if ($node === $to) {
                 return [$from, $to];
-            } else {
-                $subPath = $this->findPathInGraph($graph, $node, $to);
-                if (!empty($subPath)) {
-                    array_unshift($subPath, $from);
-                    return $subPath;
-                }
+            }
+            $subPath = $this->findPathInGraph($graph, $node, $to);
+            if (!empty($subPath)) {
+                array_unshift($subPath, $from);
+                return $subPath;
             }
         }
         return [];
index d924c9d..fbc27fe 100644 (file)
@@ -376,16 +376,13 @@ class ExtendedTemplateService extends TemplateService
         if ((string)$parts[0] !== '' && is_array($theSetup[$parts[0] . '.'])) {
             if (trim($parts[1]) !== '') {
                 return $this->ext_getSetup($theSetup[$parts[0] . '.'], trim($parts[1]));
-            } else {
-                return [$theSetup[$parts[0] . '.'], $theSetup[$parts[0]]];
-            }
-        } else {
-            if (trim($theKey) !== '') {
-                return [[], $theSetup[$theKey]];
-            } else {
-                return [$theSetup, ''];
             }
+            return [$theSetup[$parts[0] . '.'], $theSetup[$parts[0]]];
         }
+        if (trim($theKey) !== '') {
+            return [[], $theSetup[$theKey]];
+        }
+        return [$theSetup, ''];
     }
 
     /**
@@ -763,9 +760,8 @@ class ExtendedTemplateService extends TemplateService
             $tsparser->lineNumberOffset = $this->ext_lineNumberOffset + 1;
             $tsparser->parentObject = $this;
             return $tsparser->doSyntaxHighlight($all, $lineNumbers ? [$this->ext_lineNumberOffset + 1] : '', $syntaxHLBlockmode);
-        } else {
-            return $this->ext_formatTS($all, $lineNumbers, $comments, $crop);
         }
+        return $this->ext_formatTS($all, $lineNumbers, $comments, $crop);
     }
 
     /**
@@ -785,9 +781,8 @@ class ExtendedTemplateService extends TemplateService
                     $string = GeneralUtility::fixed_lgd_cs(substr($string, 12, -12), ($chars - 3));
                     $marker = substr(md5($string), 0, 6);
                     return '##' . $marker . '_B##' . $string . '##' . $marker . '_E##';
-                } else {
-                    return GeneralUtility::fixed_lgd_cs($string, $chars - 3);
                 }
+                return GeneralUtility::fixed_lgd_cs($string, $chars - 3);
             }
         }
         return $string;
index 9a3c3cd..4ee303f 100644 (file)
@@ -360,7 +360,8 @@ class TypoScriptParser
                         $this->error('Line ' . ($this->lineNumberOffset + $this->rawP - 1) . ': On return to [GLOBAL] scope, the script was short of ' . $this->inBrace . ' end brace(s)', 1);
                         $this->inBrace = 0;
                         return $line;
-                    } elseif ($line[0] !== '}' && $line[0] !== '#' && $line[0] !== '/') {
+                    }
+                    if ($line[0] !== '}' && $line[0] !== '#' && $line[0] !== '/') {
                         // If not brace-end or comment
                         // Find object name string until we meet an operator
                         $varL = strcspn($line, TAB . ' {=<>(');
@@ -647,11 +648,11 @@ class TypoScriptParser
                 $retArr[1] = $setup[$subKey];
             }
             return $retArr;
-        } else {
-            if ($setup[$subKey]) {
-                return $this->getVal($remainingKey, $setup[$subKey]);
-            }
         }
+        if ($setup[$subKey]) {
+            return $this->getVal($remainingKey, $setup[$subKey]);
+        }
+
         return [];
     }
 
index 156a3ab..6752821 100644 (file)
@@ -1353,7 +1353,8 @@ class TemplateService
         $file = trim($fileFromSetup);
         if (!$file) {
             return null;
-        } elseif (strpos($file, '../') !== false) {
+        }
+        if (strpos($file, '../') !== false) {
             if ($this->tt_track) {
                 $this->getTimeTracker()->setTSlogMessage('File path "' . $file . '" contained illegal string "../"!', 3);
             }
@@ -1456,9 +1457,8 @@ class TemplateService
         GeneralUtility::logDeprecatedFunction();
         if (substr($url, -1) === '?') {
             return substr($url, 0, -1);
-        } else {
-            return $url;
         }
+        return $url;
     }
 
     /**
index 2b65481..0b2a540 100644 (file)
@@ -302,14 +302,14 @@ class GeneralUtility
         $list = trim($list);
         if ($list === '') {
             return false;
-        } elseif ($list === '*') {
+        }
+        if ($list === '*') {
             return true;
         }
         if (strpos($baseIP, ':') !== false && self::validIPv6($baseIP)) {
             return self::cmpIPv6($baseIP, $list);
-        } else {
-            return self::cmpIPv4($baseIP, $list);
         }
+        return self::cmpIPv4($baseIP, $list);
     }
 
     /**
@@ -605,9 +605,8 @@ class GeneralUtility
                         if ($wildcardMatched) {
                             // Match found by recursive compare
                             return true;
-                        } else {
-                            $yes = false;
                         }
+                        $yes = false;
                     }
                 } elseif ($baseHostNameParts[$index] !== $val) {
                     // In case of no match
@@ -1091,13 +1090,12 @@ class GeneralUtility
     {
         if (isset(self::$idnaStringCache[$value])) {
             return self::$idnaStringCache[$value];
-        } else {
-            if (!self::$idnaConverter) {
-                self::$idnaConverter = new \Mso\IdnaConvert\IdnaConvert(['idn_version' => 2008]);
-            }
-            self::$idnaStringCache[$value] = self::$idnaConverter->encode($value);
-            return self::$idnaStringCache[$value];
         }
+        if (!self::$idnaConverter) {
+            self::$idnaConverter = new \Mso\IdnaConvert\IdnaConvert(['idn_version' => 2008]);
+        }
+        self::$idnaStringCache[$value] = self::$idnaConverter->encode($value);
+        return self::$idnaStringCache[$value];
     }
 
     /**
@@ -1276,16 +1274,15 @@ class GeneralUtility
             $position = strrpos($string, strrev($delimiter));
             if ($position !== false) {
                 return [substr($string, 0, $position), substr($string, $position + strlen($delimiter))];
-            } else {
-                return [$string];
             }
-        } elseif ($count <= 1) {
             return [$string];
-        } else {
-            $explodedValues = explode($delimiter, strrev($string), $count);
-            $explodedValues = array_map('strrev', $explodedValues);
-            return array_reverse($explodedValues);
         }
+        if ($count <= 1) {
+            return [$string];
+        }
+        $explodedValues = explode($delimiter, strrev($string), $count);
+        $explodedValues = array_map('strrev', $explodedValues);
+        return array_reverse($explodedValues);
     }
 
     /**
@@ -3303,9 +3300,8 @@ class GeneralUtility
         if ((string)$filename !== '' && static::validPathStr($filename)) {
             // checks backpath.
             return $filename;
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -3784,7 +3780,8 @@ class GeneralUtility
                     $errorMsg = 'No method name \'' . $parts[1] . '\' in class ' . $parts[0];
                     if ($errorMode == 2) {
                         throw new \InvalidArgumentException($errorMsg, 1294585865);
-                    } elseif (!$errorMode) {
+                    }
+                    if (!$errorMode) {
                         debug($errorMsg, \TYPO3\CMS\Core\Utility\GeneralUtility::class . '::callUserFunction');
                     }
                 }
@@ -3792,7 +3789,8 @@ class GeneralUtility
                 $errorMsg = 'No class named ' . $parts[0];
                 if ($errorMode == 2) {
                     throw new \InvalidArgumentException($errorMsg, 1294585866);
-                } elseif (!$errorMode) {
+                }
+                if (!$errorMode) {
                     debug($errorMsg, \TYPO3\CMS\Core\Utility\GeneralUtility::class . '::callUserFunction');
                 }
             }
@@ -3804,7 +3802,8 @@ class GeneralUtility
                 $errorMsg = 'No function named: ' . $funcRef;
                 if ($errorMode == 2) {
                     throw new \InvalidArgumentException($errorMsg, 1294585867);
-                } elseif (!$errorMode) {
+                }
+                if (!$errorMode) {
                     debug($errorMsg, \TYPO3\CMS\Core\Utility\GeneralUtility::class . '::callUserFunction');
                 }
             }
@@ -4147,24 +4146,24 @@ class GeneralUtility
                 // reset service and return object
                 $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']]->reset();
                 return $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']];
-            } else {
-                $obj = self::makeInstance($info['className']);
-                if (is_object($obj)) {
-                    if (!@is_callable([$obj, 'init'])) {
-                        // use silent logging??? I don't think so.
-                        die('Broken service:' . DebugUtility::viewArray($info));
-                    }
-                    $obj->info = $info;
-                    // service available?
-                    if ($obj->init()) {
-                        // create persistent object
-                        $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']] = $obj;
-                        return $obj;
-                    }
-                    $error = $obj->getLastErrorArray();
-                    unset($obj);
+            }
+            $obj = self::makeInstance($info['className']);
+            if (is_object($obj)) {
+                if (!@is_callable([$obj, 'init'])) {
+                    // use silent logging??? I don't think so.
+                    die('Broken service:' . DebugUtility::viewArray($info));
                 }
+                $obj->info = $info;
+                // service available?
+                if ($obj->init()) {
+                    // create persistent object
+                    $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']] = $obj;
+                    return $obj;
+                }
+                $error = $obj->getLastErrorArray();
+                unset($obj);
             }
+
             // deactivate the service
             ExtensionManagementUtility::deactivateService($info['serviceType'], $info['serviceKey']);
         }
index c564d46..5d47524 100644 (file)
@@ -35,11 +35,11 @@ class MailUtility
         $name = self::getSystemFromName();
         if (!$address) {
             return null;
-        } elseif ($name) {
+        }
+        if ($name) {
             return [$address => $name];
-        } else {
-            return [$address];
         }
+        return [$address];
     }
 
     /**
@@ -53,9 +53,8 @@ class MailUtility
     {
         if ($GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName']) {
             return $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName'];
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
index 3635876..51a0b4a 100644 (file)
@@ -177,9 +177,9 @@ class MathUtility
                 $value = self::calculateWithPriorityToAdditionAndSubtraction(substr($string, 0, $valueLenC));
                 $string = $value . substr($string, ($valueLenC + 1));
                 return $string;
-            } else {
-                $string = substr($string, 0, $valueLenO) . self::calculateWithParentheses(substr($string, ($valueLenO + 1)));
             }
+            $string = substr($string, 0, $valueLenO) . self::calculateWithParentheses(substr($string, ($valueLenO + 1)));
+
             // Security:
             $securC--;
             if ($securC <= 0) {
index a182cb5..5dba704 100644 (file)
@@ -148,9 +148,8 @@ class RootlineUtility
         if ($this->mountPointParameter !== '') {
             if (!$GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids']) {
                 throw new \RuntimeException('Mount-Point Pages are disabled for this installation. Cannot resolve a Rootline for a page with Mount-Points', 1343462896);
-            } else {
-                $this->parseMountPointParameter();
             }
+            $this->parseMountPointParameter();
         }
         if (self::$cache === null) {
             self::$cache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_rootline');
index ee32d0e..0e37ddc 100644 (file)
@@ -345,7 +345,8 @@ class HookTest extends AbstractDataHandlerActionTestCase
             $rightValue = $right[$key] ?? null;
             if (!is_array($leftValue) && (string)$leftValue !== (string)$rightValue) {
                 return false;
-            } elseif (is_array($leftValue)) {
+            }
+            if (is_array($leftValue)) {
                 if (!$this->equals($leftValue, $rightValue)) {
                     return false;
                 }
index 9e3c6b1..d14c00e 100644 (file)
@@ -34,8 +34,7 @@ class DataStructureParsePreProcessHookReturnString
                     <sheets></sheets>
                 </T3DataStructure>
             ';
-        } else {
-            return '';
         }
+        return '';
     }
 }
index 0feedcf..57a1cab 100644 (file)
@@ -33,8 +33,7 @@ class LocalDriverFilenameFilter
     {
         if ($itemName === 'fileA' || $itemName === 'folderA/') {
             return -1;
-        } else {
-            return true;
         }
+        return true;
     }
 }
index e0f4a2f..6f177e7 100644 (file)
@@ -66,20 +66,20 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
         // Look for hook before running default code for function
         if ($hookObj = $this->hookRequest('render_table')) {
             return $hookObj->render_table($content, $conf);
-        } else {
-            // Init FlexForm configuration
-            $this->pi_initPIflexForm();
-            // Get bodytext field content
-            $field = isset($conf['field']) && trim($conf['field']) ? trim($conf['field']) : 'bodytext';
-            $content = trim($this->cObj->data[$field]);
-            if ($content === '') {
-                return '';
-            }
-            // Get configuration
-            $caption = trim($this->cObj->data['table_caption']);
-            $useTfoot = trim($this->cObj->data['table_tfoot']);
-            $headerPosition = trim($this->cObj->data['table_header_position']);
-            switch ($headerPosition) {
+        }
+        // Init FlexForm configuration
+        $this->pi_initPIflexForm();
+        // Get bodytext field content
+        $field = isset($conf['field']) && trim($conf['field']) ? trim($conf['field']) : 'bodytext';
+        $content = trim($this->cObj->data[$field]);
+        if ($content === '') {
+            return '';
+        }
+        // Get configuration
+        $caption = trim($this->cObj->data['table_caption']);
+        $useTfoot = trim($this->cObj->data['table_tfoot']);
+        $headerPosition = trim($this->cObj->data['table_header_position']);
+        switch ($headerPosition) {
                 case '1':
                     $headerPos = 'top';
                     break;
@@ -90,87 +90,86 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                     $headerPos = '';
                     break;
             }
-            $tableClass = trim($this->cObj->data['table_class']);
-            $delimiter = trim($this->cObj->data['table_delimiter']);
-            if ($delimiter) {
-                $delimiter = chr((int)$delimiter);
-            } else {
-                $delimiter = '|';
-            }
-            $quotedInput = trim($this->cObj->data['table_enclosure']);
-            if ($quotedInput) {
-                $quotedInput = chr((int)$quotedInput);
-            } else {
-                $quotedInput = '';
-            }
-            // Generate id prefix for accessible header
-            $headerScope = $headerPos === 'top' ? 'col' : 'row';
-            $headerIdPrefix = $headerScope . $this->cObj->data['uid'] . '-';
-            // Split into single lines (will become table-rows):
-            $rows = GeneralUtility::trimExplode(LF, $content);
-            reset($rows);
-            // Find number of columns to render:
-            $cols = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(
+        $tableClass = trim($this->cObj->data['table_class']);
+        $delimiter = trim($this->cObj->data['table_delimiter']);
+        if ($delimiter) {
+            $delimiter = chr((int)$delimiter);
+        } else {
+            $delimiter = '|';
+        }
+        $quotedInput = trim($this->cObj->data['table_enclosure']);
+        if ($quotedInput) {
+            $quotedInput = chr((int)$quotedInput);
+        } else {
+            $quotedInput = '';
+        }
+        // Generate id prefix for accessible header
+        $headerScope = $headerPos === 'top' ? 'col' : 'row';
+        $headerIdPrefix = $headerScope . $this->cObj->data['uid'] . '-';
+        // Split into single lines (will become table-rows):
+        $rows = GeneralUtility::trimExplode(LF, $content);
+        reset($rows);
+        // Find number of columns to render:
+        $cols = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(
                 $this->cObj->data['cols'] ? $this->cObj->data['cols'] : count(str_getcsv(current($rows), $delimiter, $quotedInput)),
                 0,
                 100
             );
-            // Traverse rows (rendering the table here)
-            $rCount = count($rows);
-            foreach ($rows as $k => $v) {
-                $cells = str_getcsv($v, $delimiter, $quotedInput);
-                $newCells = [];
-                for ($a = 0; $a < $cols; $a++) {
-                    if (trim($cells[$a]) === '') {
-                        $cells[$a] = ' ';
-                    }
-                    $cells[$a] = preg_replace('|<br */?>|i', LF, $cells[$a]);
-                    if ($headerPos === 'top' && !$k || $headerPos === 'left' && !$a) {
-                        $scope = ' scope="' . $headerScope . '"';
-                        $scope .= ' id="' . $headerIdPrefix . ($headerScope === 'col' ? $a : $k) . '"';
-                        $newCells[$a] = '<th' . $scope . '>' . $this->cObj->stdWrap($cells[$a], $conf['innerStdWrap.']) . '</th>';
+        // Traverse rows (rendering the table here)
+        $rCount = count($rows);
+        foreach ($rows as $k => $v) {
+            $cells = str_getcsv($v, $delimiter, $quotedInput);
+            $newCells = [];
+            for ($a = 0; $a < $cols; $a++) {
+                if (trim($cells[$a]) === '') {
+                    $cells[$a] = ' ';
+                }
+                $cells[$a] = preg_replace('|<br */?>|i', LF, $cells[$a]);
+                if ($headerPos === 'top' && !$k || $headerPos === 'left' && !$a) {
+                    $scope = ' scope="' . $headerScope . '"';
+                    $scope .= ' id="' . $headerIdPrefix . ($headerScope === 'col' ? $a : $k) . '"';
+                    $newCells[$a] = '<th' . $scope . '>' . $this->cObj->stdWrap($cells[$a], $conf['innerStdWrap.']) . '</th>';
+                } else {
+                    if (empty($headerPos)) {
+                        $accessibleHeader = '';
                     } else {
-                        if (empty($headerPos)) {
-                            $accessibleHeader = '';
-                        } else {
-                            $accessibleHeader = ' headers="' . $headerIdPrefix . ($headerScope === 'col' ? $a : $k) . '"';
-                        }
-                        $newCells[$a] = '<td' . $accessibleHeader . '>' . $this->cObj->stdWrap($cells[$a], $conf['innerStdWrap.']) . '</td>';
+                        $accessibleHeader = ' headers="' . $headerIdPrefix . ($headerScope === 'col' ? $a : $k) . '"';
                     }
+                    $newCells[$a] = '<td' . $accessibleHeader . '>' . $this->cObj->stdWrap($cells[$a], $conf['innerStdWrap.']) . '</td>';
                 }
-                $rows[$k] = '<tr>' . implode('', $newCells) . '</tr>';
             }
-            $addTbody = 0;
-            $tableContents = '';
-            if ($caption) {
-                $tableContents .= '
+            $rows[$k] = '<tr>' . implode('', $newCells) . '</tr>';
+        }
+        $addTbody = 0;
+        $tableContents = '';
+        if ($caption) {
+            $tableContents .= '
                                        <caption>' . $caption . '</caption>';
-            }
-            if ($headerPos === 'top' && $rows[0]) {
-                $tableContents .= '<thead>' . $rows[0] . '</thead>';
-                unset($rows[0]);
-                $addTbody = 1;
-            }
-            if ($useTfoot) {
-                $tableContents .= '<tfoot>' . $rows[$rCount - 1] . '</tfoot>';
-                unset($rows[$rCount - 1]);
-                $addTbody = 1;
-            }
-            $tmpTable = implode('', $rows);
-            if ($addTbody) {
-                $tmpTable = '<tbody>' . $tmpTable . '</tbody>';
-            }
-            $tableContents .= $tmpTable;
-            // Set header type:
-            $type = (int)$this->cObj->data['layout'];
-            // Table tag params.
-            $tableTagParams = [];
-            $tableTagParams['class'] = 'contenttable contenttable-' . $type . ($tableClass ? ' contenttable-' . $tableClass : '');
-            // Compile table output:
-            $out = '<table ' . GeneralUtility::implodeAttributes($tableTagParams) . '>' . $tableContents . '</table>';
-            // Return value
-            return $out;
         }
+        if ($headerPos === 'top' && $rows[0]) {
+            $tableContents .= '<thead>' . $rows[0] . '</thead>';
+            unset($rows[0]);
+            $addTbody = 1;
+        }
+        if ($useTfoot) {
+            $tableContents .= '<tfoot>' . $rows[$rCount - 1] . '</tfoot>';
+            unset($rows[$rCount - 1]);
+            $addTbody = 1;
+        }
+        $tmpTable = implode('', $rows);
+        if ($addTbody) {
+            $tmpTable = '<tbody>' . $tmpTable . '</tbody>';
+        }
+        $tableContents .= $tmpTable;
+        // Set header type:
+        $type = (int)$this->cObj->data['layout'];
+        // Table tag params.
+        $tableTagParams = [];
+        $tableTagParams['class'] = 'contenttable contenttable-' . $type . ($tableClass ? ' contenttable-' . $tableClass : '');
+        // Compile table output:
+        $out = '<table ' . GeneralUtility::implodeAttributes($tableTagParams) . '>' . $tableContents . '</table>';
+        // Return value
+        return $out;
     }
 
     /**
index 930ca31..30c9db4 100644 (file)
@@ -120,17 +120,17 @@ class DocumentationService
                 $success |= $this->fetchDocument($url, $key, $version, $language);
                 // Fetch next language
                 continue;
-            } else {
-                if (isset($packages[$version])) {
-                    foreach ($packages[$version] as $locale => $_) {
-                        if (GeneralUtility::isFirstPartOfStr($locale, $language)) {
-                            $success |= $this->fetchDocument($url, $key, $version, $locale);
-                            // Fetch next language (jump current foreach up to the loop of $languages)
-                            continue 2;
-                        }
+            }
+            if (isset($packages[$version])) {
+                foreach ($packages[$version] as $locale => $_) {
+                    if (GeneralUtility::isFirstPartOfStr($locale, $language)) {
+                        $success |= $this->fetchDocument($url, $key, $version, $locale);
+                        // Fetch next language (jump current foreach up to the loop of $languages)
+                        continue 2;
                     }
                 }
             }
+
             // Step 2)
             if (preg_match('/^(\d+\.\d+)\.\d+$/', $version, $matches)) {
                 // Instead of a 3-digit version, try to get it on 2 digits
index e25cd56..2ff8abf 100644 (file)
@@ -67,9 +67,8 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
     {
         if ($this->uid !== null) {
             return (int)$this->uid;
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
@@ -95,9 +94,8 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
     {
         if ($this->pid === null) {
             return null;
-        } else {
-            return (int)$this->pid;
         }
+        return (int)$this->pid;
     }
 
     /**
index 419fb4d..9769ad1 100644 (file)
@@ -127,9 +127,8 @@ class Message
     {
         if (!empty($this->arguments)) {
             return vsprintf($this->message, $this->arguments);
-        } else {
-            return $this->message;
         }
+        return $this->message;
     }
 
     /**
index e295791..e13efb9 100644 (file)
@@ -293,9 +293,8 @@ class Argument
     {
         if ($this->value === null) {
             return $this->defaultValue;
-        } else {
-            return $this->value;
         }
+        return $this->value;
     }
 
     /**
index 6659fc4..c132eac 100644 (file)
@@ -281,11 +281,11 @@ class JsonView extends AbstractView
                 }
             }
             return $array;
-        } elseif (is_object($value)) {
+        }
+        if (is_object($value)) {
             return $this->transformObject($value, $configuration);
-        } else {
-            return $value;
         }
+        return $value;
     }
 
     /**
@@ -300,41 +300,40 @@ class JsonView extends AbstractView
     {
         if ($object instanceof \DateTime) {
             return $object->format(\DateTime::ATOM);
-        } else {
-            $propertyNames = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getGettablePropertyNames($object);
+        }
+        $propertyNames = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getGettablePropertyNames($object);
 
-            $propertiesToRender = [];
-            foreach ($propertyNames as $propertyName) {
-                if (isset($configuration['_only']) && is_array($configuration['_only']) && !in_array($propertyName, $configuration['_only'])) {
-                    continue;
-                }
-                if (isset($configuration['_exclude']) && is_array($configuration['_exclude']) && in_array($propertyName, $configuration['_exclude'])) {
-                    continue;
-                }
+        $propertiesToRender = [];
+        foreach ($propertyNames as $propertyName) {
+            if (isset($configuration['_only']) && is_array($configuration['_only']) && !in_array($propertyName, $configuration['_only'])) {
+                continue;
+            }
+            if (isset($configuration['_exclude']) && is_array($configuration['_exclude']) && in_array($propertyName, $configuration['_exclude'])) {
+                continue;
+            }
 
-                $propertyValue = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName);
+            $propertyValue = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($object, $propertyName);
 
-                if (!is_array($propertyValue) && !is_object($propertyValue)) {
-                    $propertiesToRender[$propertyName] = $propertyValue;
-                } elseif (isset($configuration['_descend']) && array_key_exists($propertyName, $configuration['_descend'])) {
-                    $propertiesToRender[$propertyName] = $this->transformValue($propertyValue, $configuration['_descend'][$propertyName]);
-                }
+            if (!is_array($propertyValue) && !is_object($propertyValue)) {
+                $propertiesToRender[$propertyName] = $propertyValue;
+            } elseif (isset($configuration['_descend']) && array_key_exists($propertyName, $configuration['_descend'])) {
+                $propertiesToRender[$propertyName] = $this->transformValue($propertyValue, $configuration['_descend'][$propertyName]);
             }
-            if (isset($configuration['_exposeObjectIdentifier']) && $configuration['_exposeObjectIdentifier'] === true) {
-                if (isset($configuration['_exposedObjectIdentifierKey']) && strlen($configuration['_exposedObjectIdentifierKey']) > 0) {
-                    $identityKey = $configuration['_exposedObjectIdentifierKey'];
-                } else {
-                    $identityKey = '__identity';
-                }
-                $propertiesToRender[$identityKey] = $this->persistenceManager->getIdentifierByObject($object);
-            }
-            if (isset($configuration['_exposeClassName']) && ($configuration['_exposeClassName'] === self::EXPOSE_CLASSNAME_FULLY_QUALIFIED || $configuration['_exposeClassName'] === self::EXPOSE_CLASSNAME_UNQUALIFIED)) {
-                $className = get_class($object);
-                $classNameParts = explode('\\', $className);
-                $propertiesToRender['__class'] = ($configuration['_exposeClassName'] === self::EXPOSE_CLASSNAME_FULLY_QUALIFIED ? $className : array_pop($classNameParts));
+        }
+        if (isset($configuration['_exposeObjectIdentifier']) && $configuration['_exposeObjectIdentifier'] === true) {
+            if (isset($configuration['_exposedObjectIdentifierKey']) && strlen($configuration['_exposedObjectIdentifierKey']) > 0) {
+                $identityKey = $configuration['_exposedObjectIdentifierKey'];
+            } else {
+                $identityKey = '__identity';
             }
-
-            return $propertiesToRender;
+            $propertiesToRender[$identityKey] = $this->persistenceManager->getIdentifierByObject($object);
         }
+        if (isset($configuration['_exposeClassName']) && ($configuration['_exposeClassName'] === self::EXPOSE_CLASSNAME_FULLY_QUALIFIED || $configuration['_exposeClassName'] === self::EXPOSE_CLASSNAME_UNQUALIFIED)) {
+            $className = get_class($object);
+            $classNameParts = explode('\\', $className);
+            $propertiesToRender['__class'] = ($configuration['_exposeClassName'] === self::EXPOSE_CLASSNAME_FULLY_QUALIFIED ? $className : array_pop($classNameParts));
+        }
+
+        return $propertiesToRender;
     }
 }
index 4da614e..cc74137 100644 (file)
@@ -151,9 +151,8 @@ class Request extends \TYPO3\CMS\Extbase\Mvc\Request
     {
         if ($this->environmentService->isEnvironmentInBackendMode()) {
             return $this->baseUri . TYPO3_mainDir;
-        } else {
-            return $this->baseUri;
         }
+        return $this->baseUri;
     }
 
     /**
index 24bc638..10cd7c8 100644 (file)
@@ -208,7 +208,8 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface
             $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
             if (isset($configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved']) && (bool)$configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved']) {
                 throw new \TYPO3\CMS\Core\Error\Http\PageNotFoundException('The requested resource was not found', 1313857897);
-            } elseif (isset($configuration['mvc']['callDefaultActionIfActionCantBeResolved']) && (bool)$configuration['mvc']['callDefaultActionIfActionCantBeResolved']) {
+            }
+            if (isset($configuration['mvc']['callDefaultActionIfActionCantBeResolved']) && (bool)$configuration['mvc']['callDefaultActionIfActionCantBeResolved']) {
                 return $this->defaultControllerName;
             }
             throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidControllerNameException(
@@ -246,7 +247,8 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface
             $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
             if (isset($configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved']) && (bool)$configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved']) {
                 throw new \TYPO3\CMS\Core\Error\Http\PageNotFoundException('The requested resource was not found', 1313857898);
-            } elseif (isset($configuration['mvc']['callDefaultActionIfActionCantBeResolved']) && (bool)$configuration['mvc']['callDefaultActionIfActionCantBeResolved']) {
+            }
+            if (isset($configuration['mvc']['callDefaultActionIfActionCantBeResolved']) && (bool)$configuration['mvc']['callDefaultActionIfActionCantBeResolved']) {
                 return $defaultActionName;
             }
             throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidActionNameException('The action "' . $actionName . '" (controller "' . $controllerName . '") is not allowed by this plugin. Please check TYPO3\\CMS\\Extbase\\Utility\\ExtensionUtility::configurePlugin() in your ext_localconf.php.', 1313855175);
index 5177f26..f27a506 100644 (file)
@@ -622,9 +622,8 @@ class UriBuilder
     {
         if ($this->environmentService->isEnvironmentInBackendMode()) {
             return $this->buildBackendUri();
-        } else {
-            return $this->buildFrontendUri();
         }
+        return $this->buildFrontendUri();
     }
 
     /**
index c35e12c..c703602 100644 (file)
@@ -283,12 +283,11 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
     {
         if ($this->session->hasIdentifier($identifier, $className)) {
             return $this->session->getObjectByIdentifier($identifier, $className);
-        } else {
-            $query = $this->persistenceManager->createQueryForType($className);
-            $query->getQuerySettings()->setRespectStoragePage(false);
-            $query->getQuerySettings()->setRespectSysLanguage(false);
-            return $query->matching($query->equals('uid', $identifier))->execute()->getFirst();
         }
+        $query = $this->persistenceManager->createQueryForType($className);
+        $query->getQuerySettings()->setRespectStoragePage(false);
+        $query->getQuerySettings()->setRespectSysLanguage(false);
+        return $query->matching($query->equals('uid', $identifier))->execute()->getFirst();
     }
 
     /**
index f92d070..b4001c1 100644 (file)
@@ -86,9 +86,8 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene
             $this->parentObject->_setProperty($this->propertyName, $propertyValue);
             $this->parentObject->_memorizeCleanState($this->propertyName);
             return $propertyValue;
-        } else {
-            return $this->parentObject->_getProperty($this->propertyName);
         }
+        return $this->parentObject->_getProperty($this->propertyName);
     }
 
     /**
index fb49f9f..4adb5be 100644 (file)
@@ -325,16 +325,16 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface
         if (empty($value) || $value === '0000-00-00' || $value === '0000-00-00 00:00:00') {
             // 0 -> NULL !!!
             return null;
-        } elseif ($storageFormat === 'date' || $storageFormat === 'datetime') {
+        }
+        if ($storageFormat === 'date' || $storageFormat === 'datetime') {
             // native date/datetime values are stored in UTC
             $utcTimeZone = new \DateTimeZone('UTC');
             $utcDateTime = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, $value, $utcTimeZone);
             $currentTimeZone = new \DateTimeZone(date_default_timezone_get());
             return $utcDateTime->setTimezone($currentTimeZone);
-        } else {
-            // integer timestamps are local server time
-            return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, date('c', $value));
         }
+        // integer timestamps are local server time
+        return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, date('c', $value));
     }
 
     /**
index 65d46e3..29145b7 100644 (file)
@@ -160,9 +160,8 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
         }
         if ($this->persistenceSession->hasIdentifier($identifier, $objectType)) {
             return $this->persistenceSession->getObjectByIdentifier($identifier, $objectType);
-        } else {
-            return $this->backend->getObjectByIdentifier($identifier, $objectType);
         }
+        return $this->backend->getObjectByIdentifier($identifier, $objectType);
     }
 
     /**
index c90660b..64d7d83 100644 (file)
@@ -208,9 +208,8 @@ class Query implements QueryInterface
         $source = $this->getSource();
         if ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
             return $source->getSelectorName();
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -237,9 +236,8 @@ class Query implements QueryInterface
     {
         if ($returnRawQueryResult) {
             return $this->persistenceManager->getObjectDataByQuery($this);
-        } else {
-            return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface::class, $this);
         }
+        return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface::class, $this);
     }
 
     /**
index 1f7758c..d82e9aa 100644 (file)
@@ -509,9 +509,8 @@ class Typo3DbBackend implements BackendInterface, SingletonInterface
                 ->fetchColumn(0);
             if ($uid > 0) {
                 return $uid;
-            } else {
-                return false;
             }
+            return false;
         } catch (DBALException $e) {
             throw new SqlErrorException($e->getPrevious()->getMessage(), 1470231748);
         }
index b54916a..84b0bbe 100644 (file)
@@ -198,10 +198,10 @@ class Typo3DbQueryParser
                     $this->parseConstraint($constraint1, $source),
                     $this->parseConstraint($constraint2, $source)
                 );
-            } else {
-                return '';
             }
-        } elseif ($constraint instanceof Qom\OrInterface) {
+            return '';
+        }
+        if ($constraint instanceof Qom\OrInterface) {
             $constraint1 = $constraint->getConstraint1();
             $constraint2 = $constraint->getConstraint2();
             if (($constraint1 instanceof Qom\ConstraintInterface)
@@ -211,16 +211,16 @@ class Typo3DbQueryParser
                     $this->parseConstraint($constraint->getConstraint1(), $source),
                     $this->parseConstraint($constraint->getConstraint2(), $source)
                 );
-            } else {
-                return '';
             }
-        } elseif ($constraint instanceof Qom\NotInterface) {
+            return '';
+        }
+        if ($constraint instanceof Qom\NotInterface) {
             return ' NOT(' . $this->parseConstraint($constraint->getConstraint(), $source) . ')';
-        } elseif ($constraint instanceof Qom\ComparisonInterface) {
+        }
+        if ($constraint instanceof Qom\ComparisonInterface) {
             return $this->parseComparison($constraint, $source);
-        } else {
-            throw new \RuntimeException('not implemented', 1476199898);
         }
+        throw new \RuntimeException('not implemented', 1476199898);
     }
 
     /**
@@ -300,27 +300,27 @@ class Typo3DbQueryParser
         if ($comparison->getOperator() === QueryInterface::OPERATOR_CONTAINS) {
             if ($comparison->getOperand2() === null) {
                 throw new Exception\BadConstraintException('The value for the CONTAINS operator must not be null.', 1484828468);
-            } else {
-                $value = $this->dataMapper->getPlainValue($comparison->getOperand2());
-                if (!$source instanceof Qom\SelectorInterface) {
-                    throw new \RuntimeException('Source is not of type "SelectorInterface"', 1395362539);
-                }
-                $className = $source->getNodeTypeName();
-                $tableName = $this->dataMapper->convertClassNameToTableName($className);
-                $operand1 = $comparison->getOperand1();
-                $propertyName = $operand1->getPropertyName();
-                $fullPropertyPath = '';
-                while (strpos($propertyName, '.') !== false) {
-                    $this->addUnionStatement($className, $tableName, $propertyName, $fullPropertyPath);
-                }
-                $columnName = $this->dataMapper->convertPropertyNameToColumnName($propertyName, $className);
-                $dataMap = $this->dataMapper->getDataMap($className);
-                $columnMap = $dataMap->getColumnMap($propertyName);
-                $typeOfRelation = $columnMap instanceof ColumnMap ? $columnMap->getTypeOfRelation() : null;
-                if ($typeOfRelation === ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
-                    $relationTableName = $columnMap->getRelationTableName();
-                    $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
-                    $queryBuilderForSubselect
+            }
+            $value = $this->dataMapper->getPlainValue($comparison->getOperand2());
+            if (!$source instanceof Qom\SelectorInterface) {
+                throw new \RuntimeException('Source is not of type "SelectorInterface"', 1395362539);
+            }
+            $className = $source->getNodeTypeName();
+            $tableName = $this->dataMapper->convertClassNameToTableName($className);
+            $operand1 = $comparison->getOperand1();
+            $propertyName = $operand1->getPropertyName();
+            $fullPropertyPath = '';
+            while (strpos($propertyName, '.') !== false) {
+                $this->addUnionStatement($className, $tableName, $propertyName, $fullPropertyPath);
+            }
+            $columnName = $this->dataMapper->convertPropertyNameToColumnName($propertyName, $className);
+            $dataMap = $this->dataMapper->getDataMap($className);
+            $columnMap = $dataMap->getColumnMap($propertyName);
+            $typeOfRelation = $columnMap instanceof ColumnMap ? $columnMap->getTypeOfRelation() : null;
+            if ($typeOfRelation === ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
+                $relationTableName = $columnMap->getRelationTableName();
+                $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
+                $queryBuilderForSubselect
                         ->select($columnMap->getParentKeyFieldName())
                         ->from($relationTableName)
                         ->where(
@@ -329,24 +329,25 @@ class Typo3DbQueryParser
                                 $this->queryBuilder->createNamedParameter($value)
                             )
                         );
-                    $additionalWhereForMatchFields = $this->getAdditionalMatchFieldsStatement($queryBuilderForSubselect->expr(), $columnMap, $relationTableName, $relationTableName);
-                    if ($additionalWhereForMatchFields) {
-                        $queryBuilderForSubselect->andWhere($additionalWhereForMatchFields);
-                    }
+                $additionalWhereForMatchFields = $this->getAdditionalMatchFieldsStatement($queryBuilderForSubselect->expr(), $columnMap, $relationTableName, $relationTableName);
+                if ($additionalWhereForMatchFields) {
+                    $queryBuilderForSubselect->andWhere($additionalWhereForMatchFields);
+                }
 
-                    return $this->queryBuilder->expr()->comparison(
+                return $this->queryBuilder->expr()->comparison(
                         $this->queryBuilder->quoteIdentifier($tableName . '.uid'),
                         'IN',
                         '(' . $queryBuilderForSubselect->getSQL() . ')'
                     );
-                } elseif ($typeOfRelation === ColumnMap::RELATION_HAS_MANY) {
-                    $parentKeyFieldName = $columnMap->getParentKeyFieldName();
-                    if (isset($parentKeyFieldName)) {
-                        $childTableName = $columnMap->getChildTableName();
+            }
+            if ($typeOfRelation === ColumnMap::RELATION_HAS_MANY) {
+                $parentKeyFieldName = $columnMap->getParentKeyFieldName();
+                if (isset($parentKeyFieldName)) {
+                    $childTableName = $columnMap->getChildTableName();
 
-                        // Build the SQL statement of the subselect
-                        $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
-                        $queryBuilderForSubselect
+                    // Build the SQL statement of the subselect
+                    $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
+                    $queryBuilderForSubselect
                             ->select($parentKeyFieldName)
                             ->from($childTableName)
                             ->where(
@@ -356,24 +357,20 @@ class Typo3DbQueryParser
                                 )
                             );
 
-                        // Add it to the main query
-                        return $this->queryBuilder->expr()->eq(
+                    // Add it to the main query
+                    return $this->queryBuilder->expr()->eq(
                             $tableName . '.uid',
                             '(' . $queryBuilderForSubselect->getSQL() . ')'
                         );
-                    } else {
-                        return $this->queryBuilder->expr()->inSet(
+                }
+                return $this->queryBuilder->expr()->inSet(
                             $tableName . '.' . $columnName,
                             $this->queryBuilder->quote($value)
                         );
-                    }
-                } else {
-                    throw new RepositoryException('Unsupported or non-existing property name "' . $propertyName . '" used in relation matching.', 1327065745);
-                }
             }
-        } else {
-            return $this->parseDynamicOperand($comparison, $source);
+            throw new RepositoryException('Unsupported or non-existing property name "' . $propertyName . '" used in relation matching.', 1327065745);
         }
+        return $this->parseDynamicOperand($comparison, $source);
     }
 
     /**
@@ -605,9 +602,8 @@ class Typo3DbQueryParser
 
         if (!empty($additionalWhereForMatchFields)) {
             return $exprBuilder->andX(...$additionalWhereForMatchFields);
-        } else {
-            return '';
         }
+        return '';
     }
 
     /**
@@ -763,9 +759,9 @@ class Typo3DbQueryParser
                                 )
                             )
                         );
-                    } else {
-                        $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
-                        $queryBuilderForSubselect
+                    }
+                    $queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
+                    $queryBuilderForSubselect
                             ->select($tableAlias . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
                             ->from($tableName)
                             ->where(
@@ -774,7 +770,7 @@ class Typo3DbQueryParser
                                     $queryBuilderForSubselect->expr()->eq($tableName . '.' . $languageField, (int)$querySettings->getLanguageUid())
                                 )
                             );
-                        return $this->queryBuilder->expr()->orX(
+                    return $this->queryBuilder->expr()->orX(
                             $this->queryBuilder->expr()->in($tableAlias . '.' . $languageField, [(int)$querySettings->getLanguageUid(), -1]),
                             $this->queryBuilder->expr()->andX(
                                 $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, 0),
@@ -785,13 +781,11 @@ class Typo3DbQueryParser
                                 )
                             )
                         );
-                    }
-                } else {
-                    return $this->queryBuilder->expr()->in(
+                }
+                return $this->queryBuilder->expr()->in(
                         $tableAlias . '.' . $languageField,
                         [(int)$querySettings->getLanguageUid(), -1]
                     );
-                }
             }
         }
         return '';
@@ -839,9 +833,8 @@ class Typo3DbQueryParser
         $storagePageIds = array_map('intval', $storagePageIds);
         if (count($storagePageIds) === 1) {
             return $this->queryBuilder->expr()->eq($tableAlias . '.pid', reset($storagePageIds));
-        } else {
-            return $this->queryBuilder->expr()->in($tableAlias . '.pid', $storagePageIds);
         }
+        return $this->queryBuilder->expr()->in($tableAlias . '.pid', $storagePageIds);
     }
 
     /**
index 9932903..d3830d4 100644 (file)
@@ -233,14 +233,16 @@ class Repository implements RepositoryInterface, \TYPO3\CMS\Core\SingletonInterf
             $query = $this->createQuery();
             $result = $query->matching($query->equals($propertyName, $arguments[0]))->execute();
             return $result;
-        } elseif (substr($methodName, 0, 9) === 'findOneBy' && strlen($methodName) > 10) {
+        }
+        if (substr($methodName, 0, 9) === 'findOneBy' && strlen($methodName) > 10) {
             $propertyName = lcfirst(substr($methodName, 9));
             $query = $this->createQuery();
 
             $result = $query->matching($query->equals($propertyName, $arguments[0]))->setLimit(1)->execute();
             if ($result instanceof QueryResultInterface) {
                 return $result->getFirst();
-            } elseif (is_array($result)) {
+            }
+            if (is_array($result)) {
                 return isset($result[0]) ? $result[0] : null;
             }
         } elseif (substr($methodName, 0, 7) === 'countBy' && strlen($methodName) > 8) {
index 727cf99..cd98ebe 100644 (file)
@@ -302,9 +302,8 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface
         }
         if (isset($convertersForSource['object'])) {
             return $this->findEligibleConverterWithHighestPriority($convertersForSource['object'], $source, $targetClass);
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
@@ -362,17 +361,20 @@ class PropertyMapper implements \TYPO3\CMS\Core\SingletonInterface
     {
         if (is_string($source)) {
             return 'string';
-        } elseif (is_array($source)) {
+        }
+        if (is_array($source)) {
             return 'array';
-        } elseif (is_float($source)) {
+        }
+        if (is_float($source)) {
             return 'float';
-        } elseif (is_int($source)) {
+        }
+        if (is_int($source)) {
             return 'integer';
-        } elseif (is_bool($source)) {
+        }
+        if (is_bool($source)) {
             return 'boolean';
-        } else {
-            throw new Exception\InvalidSourceException('The source is not of type string, array, float, integer or boolean, but of type "' . gettype($source) . '"', 1297773150);
         }
+        throw new Exception\InvalidSourceException('The source is not of type string, array, float, integer or boolean, but of type "' . gettype($source) . '"', 1297773150);
     }
 
     /**
index e845ea6..3ef22d5 100644 (file)
@@ -241,7 +241,8 @@ class PropertyMappingConfiguration implements PropertyMappingConfigurationInterf
     {
         if (isset($this->subConfigurationForProperty[$propertyName])) {
             return $this->subConfigurationForProperty[$propertyName];
-        } elseif (isset($this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER])) {
+        }
+        if (isset($this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER])) {
             return $this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER];
         }
 
index e43413b..37375ab 100644 (file)
@@ -199,7 +199,8 @@ class DateTimeConverter extends \TYPO3\CMS\Extbase\Property\TypeConverter\Abstra
         $dateFormat = $configuration->getConfigurationValue(\TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter::class, self::CONFIGURATION_DATE_FORMAT);
         if ($dateFormat === null) {
             return self::DEFAULT_DATE_FORMAT;
-        } elseif ($dateFormat !== null && !is_string($dateFormat)) {
+        }
+        if ($dateFormat !== null && !is_string($dateFormat)) {
             throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidPropertyMappingConfigurationException('CONFIGURATION_DATE_FORMAT must be of type string, "' . (is_object($dateFormat) ? get_class($dateFormat) : gettype($dateFormat)) . '" given', 1307719569);
         }
         return $dateFormat;
index a87e7ab..badf8bc 100644 (file)
@@ -126,17 +126,14 @@ class ObjectConverter extends AbstractTypeConverter implements \TYPO3\CMS\Core\S
             $methodParameter = current($methodParameters);
             if (!isset($methodParameter['type'])) {
                 throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('Setter for property "' . $propertyName . '" had no type hint or documentation in target object of type "' . $specificTargetType . '".', 1303379158);
-            } else {
-                return $methodParameter['type'];
-            }
-        } else {
-            $methodParameters = $this->reflectionService->getMethodParameters($specificTargetType, '__construct');
-            if (isset($methodParameters[$propertyName]) && isset($methodParameters[$propertyName]['type'])) {
-                return $methodParameters[$propertyName]['type'];
-            } else {
-                throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('Property "' . $propertyName . '" had no setter or constructor argument in target object of type "' . $specificTargetType . '".', 1303379126);
             }
+            return $methodParameter['type'];
+        }
+        $methodParameters = $this->reflectionService->getMethodParameters($specificTargetType, '__construct');
+        if (isset($methodParameters[$propertyName]) && isset($methodParameters[$propertyName]['type'])) {
+            return $methodParameters[$propertyName]['type'];
         }
+        throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidTargetException('Property "' . $propertyName . '" had no setter or constructor argument in target object of type "' . $specificTargetType . '".', 1303379126);
     }
 
     /**
@@ -230,8 +227,7 @@ class ObjectConverter extends AbstractTypeConverter implements \TYPO3\CMS\Core\S
                 }
             }
             return call_user_func_array([$this->objectManager, 'get'], array_merge([$objectType], $constructorArguments));
-        } else {
-            return $this->objectManager->get($objectType);
         }
+        return $this->objectManager->get($objectType);
     }
 }
index 7ea8070..3152ff5 100644 (file)
@@ -81,7 +81,8 @@ class ObjectAccess
         // type check and conversion of iterator to numerically indexed array
         if ($subject === null || is_scalar($subject)) {
             return null;
-        } elseif (!$forceDirectAccess && ($subject instanceof \SplObjectStorage || $subject instanceof ObjectStorage)) {
+        }
+        if (!$forceDirectAccess && ($subject instanceof \SplObjectStorage || $subject instanceof ObjectStorage)) {
             $subject = iterator_to_array(clone $subject, false);
         }
 
@@ -97,9 +98,8 @@ class ObjectAccess
                 if (property_exists($subject, $propertyName)) {
                     $propertyReflection = new PropertyReflection($subject, $propertyName);
                     return $propertyReflection->getValue($subject);
-                } else {
-                    throw new Exception\PropertyNotAccessibleException('The property "' . $propertyName . '" on the subject does not exist.', 1302855001);
                 }
+                throw new Exception\PropertyNotAccessibleException('The property "' . $propertyName . '" on the subject does not exist.', 1302855001);
             }
             $upperCasePropertyName = ucfirst($propertyName);
             $getterMethodName = 'get' . $upperCasePropertyName;
@@ -116,9 +116,8 @@ class ObjectAccess
             }
             if (property_exists($subject, $propertyName)) {
                 return $subject->{$propertyName};
-            } else {
-                throw new Exception\PropertyNotAccessibleException('The property "' . $propertyName . '" on the subject does not exist.', 1476109666);
             }
+            throw new Exception\PropertyNotAccessibleException('The property "' . $propertyName . '" on the subject does not exist.', 1476109666);
         }
 
         return null;
@@ -312,7 +311,8 @@ class ObjectAccess
         }
         if ($object instanceof \stdClass && array_search($propertyName, array_keys(get_object_vars($object))) !== false) {
             return true;
-        } elseif (array_search($propertyName, array_keys(get_class_vars(get_class($object)))) !== false) {
+        }
+        if (array_search($propertyName, array_keys(get_class_vars(get_class($object)))) !== false) {
             return true;
         }
         return is_callable([$object, self::buildSetterMethodName($propertyName)]);
@@ -334,7 +334,8 @@ class ObjectAccess
         }
         if ($object instanceof \ArrayAccess && isset($object[$propertyName])) {
             return true;
-        } elseif ($object instanceof \stdClass && isset($object->$propertyName)) {
+        }
+        if ($object instanceof \stdClass && isset($object->$propertyName)) {
             return true;
         }
         if (is_callable([$object, 'get' . ucfirst($propertyName)])) {
index e775cbc..06a2842 100644 (file)
@@ -275,9 +275,8 @@ class ReflectionService implements \TYPO3\CMS\Core\SingletonInterface
         $className = is_object($classNameOrObject) ? get_class($classNameOrObject) : $classNameOrObject;
         if (isset($this->classSchemata[$className])) {
             return $this->classSchemata[$className];
-        } else {
-            return $this->buildClassSchema($className);
         }
+        return $this->buildClassSchema($className);
     }
 
     /**
index 94385f0..5fca650 100644 (file)
@@ -102,9 +102,8 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface
                 $uriPrefix = (GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https:' : 'http:') . $uriPrefix;
             }
             return GeneralUtility::locationHeaderUrl($uriPrefix . $imageUrl);
-        } else {
-            return $uriPrefix . $imageUrl;
         }
+        return $uriPrefix . $imageUrl;
     }
 
     /**
index e6dc178..bfe3d9b 100644 (file)
@@ -140,12 +140,12 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface
                 if (!is_array($slotReturn)) {
                     throw new Exception\InvalidSlotReturnException('The slot method ' . get_class($object) . '->' . $slotInformation['method'] . '()\'s return value is of an not allowed type ('
                         . gettype($slotReturn) . ').', 1376683067);
-                } elseif (count($slotReturn) !== count($signalArguments)) {
+                }
+                if (count($slotReturn) !== count($signalArguments)) {
                     throw new Exception\InvalidSlotReturnException('The slot method ' . get_class($object) . '->' . $slotInformation['method'] . '() returned a different number ('
                         . count($slotReturn) . ') of arguments, than it received (' . count($signalArguments) . ').', 1376683066);
-                } else {
-                    $signalArguments = $slotReturn;
                 }
+                $signalArguments = $slotReturn;
             }
         }
 
index 6d49c36..935846a 100644 (file)
@@ -203,9 +203,8 @@ class ArrayUtility
                 return is_array($array[$key]) ? self::getValueByPath($array[$key], $path) : null;
             }
             return $array[$key];
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
index 5711fb2..c524e71 100644 (file)
@@ -188,9 +188,8 @@ class DebuggerUtility
         }
         if ($plainText) {
             return $header . $content;
-        } else {
-            return '<span class="extbase-debugger-tree">' . $header . '<span class="extbase-debug-content">' . $content . '</span></span>';
         }
+        return '<span class="extbase-debugger-tree">' . $header . '<span class="extbase-debug-content">' . $content . '</span></span>';
     }
 
     /**
@@ -212,9 +211,8 @@ class DebuggerUtility
         }
         if ($plainText) {
             return $header . $content;
-        } else {
-            return '<span class="extbase-debugger-tree"><input type="checkbox" /><span class="extbase-debug-header">' . $header . '</span><span class="extbase-debug-content">' . $content . '</span></span>';
         }
+        return '<span class="extbase-debugger-tree"><input type="checkbox" /><span class="extbase-debug-header">' . $header . '</span><span class="extbase-debug-content">' . $content . '</span></span>';
     }
 
     /**
@@ -484,9 +482,8 @@ class DebuggerUtility
     {
         if ($enable) {
             return '\e[' . $ansiColors . 'm' . $string . '\e[0m';
-        } else {
-            return $string;
         }
+        return $string;
     }
 
     /**
@@ -569,9 +566,9 @@ class DebuggerUtility
         self::$blacklistedPropertyNames = $backupBlacklistedPropertyNames;
         if ($return === true) {
             return $css . $output;
-        } else {
-            echo $css . $output;
         }
+        echo $css . $output;
+
         return '';
     }
 }
index b23b9bb..0b90651 100644 (file)
@@ -119,9 +119,8 @@ class LocalizationUtility
         }
         if (is_array($arguments) && $value !== null) {
             return vsprintf($value, $arguments);
-        } else {
-            return $value;
         }
+        return $value;
     }
 
     /**
@@ -137,12 +136,12 @@ class LocalizationUtility
         if (TYPO3_MODE === 'FE') {
             $value = self::getTypoScriptFrontendController()->sL($key);
             return $value !== false ? $value : null;
-        } elseif (is_object($GLOBALS['LANG'])) {
+        }
+        if (is_object($GLOBALS['LANG'])) {
             $value = self::getLanguageService()->sL($key);
             return $value !== '' ? $value : null;
-        } else {
-            return $key;
         }
+        return $key;
     }
 
     /**
index da0b32d..a363b85 100644 (file)
@@ -54,9 +54,8 @@ class TypeHandlingUtility
                 'type' => $type,
                 'elementType' => $elementType
             ];
-        } else {
-            throw new \TYPO3\CMS\Extbase\Utility\Exception\InvalidTypeException('Found an invalid element type declaration in %s. A type "' . var_export($type, true) . '" does not exist.', 1264093630);
         }
+        throw new \TYPO3\CMS\Extbase\Utility\Exception\InvalidTypeException('Found an invalid element type declaration in %s. A type "' . var_export($type, true) . '" does not exist.', 1264093630);
     }
 
     /**
index 9c0d47b..45705b9 100644 (file)
@@ -59,13 +59,14 @@ class CollectionValidator extends GenericObjectValidator
             if ((is_object($value) && !\TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::isCollectionType(get_class($value))) && !is_array($value)) {
                 $this->addError('The given subject was not a collection.', 1317204797);
                 return $this->result;
-            } elseif ($value instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage && !$value->isInitialized()) {
+            }
+            if ($value instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage && !$value->isInitialized()) {
                 return $this->result;
-            } elseif (is_object($value) && $this->isValidatedAlready($value)) {
+            }
+            if (is_object($value) && $this->isValidatedAlready($value)) {
                 return $this->result;
-            } else {
-                $this->isValid($value);
             }
+            $this->isValid($value);
         }
         return $this->result;
     }
index 97ccecc..a45aaf9 100644 (file)
@@ -62,9 +62,8 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
         // @todo add support for lazy loading proxies, if needed
         if (ObjectAccess::isPropertyGettable($object, $propertyName)) {
             return ObjectAccess::getProperty($object, $propertyName);
-        } else {
-            return ObjectAccess::getProperty($object, $propertyName, true);
         }
+        return ObjectAccess::getProperty($object, $propertyName, true);
     }
 
     /**
@@ -149,11 +148,10 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
         }
         if ($this->validatedInstancesContainer->contains($object)) {
             return true;
-        } else {
-            $this->validatedInstancesContainer->attach($object);
-
-            return false;
         }
+        $this->validatedInstancesContainer->attach($object);
+
+        return false;
     }
 
     /**
@@ -166,9 +164,8 @@ class GenericObjectValidator extends AbstractValidator implements ObjectValidato
     {
         if ($propertyName !== null) {
             return (isset($this->propertyValidators[$propertyName])) ? $this->propertyValidators[$propertyName] : [];
-        } else {
-            return $this->propertyValidators;
         }
+        return $this->propertyValidators;
     }
 
     /**
index 899bfef..689f441 100644 (file)
@@ -80,9 +80,8 @@ class PersistentObjectConverterTest extends \TYPO3\TestingFramework\Core\Unit\Un
                 $reflectionClass = new \ReflectionClass($className);
                 if (empty($arguments)) {
                     return $reflectionClass->newInstance();
-                } else {
-                    return $reflectionClass->newInstanceArgs($arguments);
                 }
+                return $reflectionClass->newInstanceArgs($arguments);
             }));
         $this->inject($this->converter, 'objectManager', $this->mockObjectManager);
 
index 0045d31..d8490f6 100644 (file)
@@ -396,12 +396,11 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface
                         'The extension ' . $extensionKey . ' is not available from TER.',
                         1399161266
                     );
-                } else {
-                    throw new Exception\MissingExtensionDependencyException(
+                }
+                throw new Exception\MissingExtensionDependencyException(
                         'The extension ' . $extensionKey . ' could not be checked. Please update your Extension-List from TYPO3 Extension Repository (TER).',
                         1430580308
                     );
-                }
             }
             return;
         }
@@ -626,12 +625,11 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface
             if (!array_key_exists($extensionKey, $filteredExtensions)) {
                 $filteredExtensions[$extensionKey] = $extension;
                 continue;
-            } else {
-                $currentVersion = $filteredExtensions[$extensionKey]->getVersion();
-                $newVersion = $extension->getVersion();
-                if (version_compare($newVersion, $currentVersion, '>')) {
-                    $filteredExtensions[$extensionKey] = $extension;
-                }
+            }
+            $currentVersion = $filteredExtensions[$extensionKey]->getVersion();
+            $newVersion = $extension->getVersion();
+            if (version_compare($newVersion, $currentVersion, '>')) {
+                $filteredExtensions[$extensionKey] = $extension;
             }
         }
         return $filteredExtensions;
index 28c2fec..3f9db8a 100644 (file)
@@ -223,9 +223,8 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
                 ),
                 1342554622
             );
-        } else {
-            $this->unloadExtension($extensionKey);
         }
+        $this->unloadExtension($extensionKey);
     }
 
     /**
@@ -355,9 +354,8 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
         $availableExtensions = $this->listUtility->getAvailableExtensions();
         if (isset($availableExtensions[$extensionKey])) {
             return $availableExtensions[$extensionKey];
-        } else {
-            throw new ExtensionManagerException('Extension ' . $extensionKey . ' is not available', 1342864081);
         }
+        throw new ExtensionManagerException('Extension ' . $extensionKey . ' is not available', 1342864081);
     }
 
     /**
index 1bc68c6..fa9c6ba 100644 (file)
@@ -127,9 +127,8 @@ class DownloadExtensionViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\Abst
     {
         if ($this->hasArgument('fieldNamePrefix')) {
             return $this->arguments['fieldNamePrefix'];
-        } else {
-            return $this->getDefaultFieldNamePrefix();
         }
+        return $this->getDefaultFieldNamePrefix();
     }
 
     /**
@@ -152,8 +151,7 @@ class DownloadExtensionViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\Abst
         }
         if ($extensionName !== null && $pluginName != null) {
             return $this->extensionService->getPluginNamespace($extensionName, $pluginName);
-        } else {
-            return '';
         }
+        return '';
     }
 }
index ee71dee..1ab3742 100644 (file)
@@ -56,9 +56,8 @@ class InstallationStateCssClassViewHelper extends AbstractViewHelper
         if (array_key_exists($needle, $haystack)) {
             if (isset($haystack[$needle]['installed']) && $haystack[$needle]['installed'] === true) {
                 return 'installed';
-            } else {
-                return 'available';
             }
+            return 'available';
         }
         return '';
     }
index 27476bf..6792f11 100644 (file)
@@ -927,9 +927,8 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
         }
         if ($returnUrl) {
             return htmlspecialchars($this->cObj->typoLink_URL($this->conf['linkConfig.']));
-        } else {
-            return $this->cObj->typoLink($label, $this->conf['linkConfig.']);
         }
+        return $this->cObj->typoLink($label, $this->conf['linkConfig.']);
     }
 
     /**