[TASK] Switch isset() and is_array() to null coalesce 16/52416/13
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 20 Nov 2017 10:33:42 +0000 (11:33 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 27 Nov 2017 21:19:52 +0000 (22:19 +0100)
Several hundred function calls and vast numbers
of indentations can be saved by using the null
coalesce operator instead of checking empty/array.

Change-Id: I38f2ce2de83a454aaa0d16c771014b6de84b3f7a
Releases: master
Resolves: #80812
Reviewed-on: https://review.typo3.org/52416
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
100 files changed:
typo3/sysext/about/Classes/Controller/AboutController.php
typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
typo3/sysext/backend/Classes/ContextMenu/ContextMenu.php
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/File/EditFileController.php
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/NewContentElementWizardController.php
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseUserPermissionCheck.php
typo3/sysext/backend/Classes/Template/Components/ButtonBar.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Classes/View/PageTreeView.php
typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
typo3/sysext/core/Classes/Authentication/AuthenticationService.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php
typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php
typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php
typo3/sysext/core/Classes/Controller/FileDumpController.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/ConnectionPool.php
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/core/Classes/Database/Schema/ConnectionMigrator.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectApi.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectRouter.php
typo3/sysext/core/Classes/FrontendEditing/FrontendEditingController.php
typo3/sysext/core/Classes/Html/RteHtmlParser.php
typo3/sysext/core/Classes/Imaging/IconFactory.php
typo3/sysext/core/Classes/Localization/Locales.php
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Classes/Session/SessionManager.php
typo3/sysext/core/Classes/Type/File/FileInfo.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/ClientUtility.php
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php
typo3/sysext/extbase/Classes/Service/ExtensionService.php
typo3/sysext/extbase/Classes/SignalSlot/Dispatcher.php
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/form/Classes/Controller/FormEditorController.php
typo3/sysext/form/Classes/Controller/FormManagerController.php
typo3/sysext/form/Classes/Domain/Factory/AbstractFormFactory.php
typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php
typo3/sysext/form/Classes/Domain/Model/FormElements/Section.php
typo3/sysext/form/Classes/Domain/Model/FormElements/UnknownFormElement.php
typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php
typo3/sysext/form/Classes/Domain/Renderer/FluidFormRenderer.php
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/form/Classes/ViewHelpers/RenderRenderableViewHelper.php
typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Hooks/MediaItemHooks.php
typo3/sysext/frontend/Classes/Http/EidRequestHandler.php
typo3/sysext/frontend/Classes/Http/RequestHandler.php
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php
typo3/sysext/frontend/Classes/Typolink/AbstractTypolinkBuilder.php
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/info/Classes/Controller/PageInformationController.php
typo3/sysext/linkvalidator/Classes/LinkAnalyzer.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php
typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php
typo3/sysext/recordlist/Classes/RecordList.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/reports/Classes/Controller/ReportController.php
typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/Classes/Task/OptimizeDatabaseTableAdditionalFieldProvider.php
typo3/sysext/scheduler/ext_localconf.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php
typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
typo3/sysext/workspaces/ext_localconf.php

index 58d8320..3c23f3b 100644 (file)
@@ -65,12 +65,10 @@ class AboutController extends ActionController
     {
         $warnings = [];
         // Hook for additional warnings
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
-                    $hookObj->displayWarningMessages_postProcess($warnings);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
+                $hookObj->displayWarningMessages_postProcess($warnings);
             }
         }
 
index 19e727e..85675b8 100644 (file)
@@ -135,13 +135,10 @@ class Avatar
      */
     protected function validateSortAndInitiateAvatarProviders()
     {
-        if (
-            empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['avatarProviders'])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['avatarProviders'])
-        ) {
+        $providers = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['avatarProviders'] ?? [];
+        if (empty($providers)) {
             return;
         }
-        $providers = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['avatarProviders'];
         foreach ($providers as $identifier => $configuration) {
             if (empty($configuration) || !is_array($configuration)) {
                 throw new \RuntimeException(
index d196b4d..37b7931 100644 (file)
@@ -75,14 +75,12 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
         }
 
         // Hook for manipulating cacheActions
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'] as $cacheAction) {
-                $hookObject = GeneralUtility::makeInstance($cacheAction);
-                if (!$hookObject instanceof ClearCacheActionsHookInterface) {
-                    throw new \UnexpectedValueException($cacheAction . ' must implement interface ' . ClearCacheActionsHookInterface::class, 1228262000);
-                }
-                $hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'] ?? [] as $cacheAction) {
+            $hookObject = GeneralUtility::makeInstance($cacheAction);
+            if (!$hookObject instanceof ClearCacheActionsHookInterface) {
+                throw new \UnexpectedValueException($cacheAction . ' must implement interface ' . ClearCacheActionsHookInterface::class, 1228262000);
             }
+            $hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
         }
     }
 
index b72da3e..b798535 100644 (file)
@@ -59,11 +59,7 @@ class ContextMenu
      */
     protected function getAvailableProviders(string $table, string $identifier, string $context): array
     {
-        $providers = $this->itemProviders;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'])) {
-            $providers = array_merge($this->itemProviders, $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders']);
-        }
-
+        $providers = array_merge($this->itemProviders, $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'] ?? []);
         $availableProviders = [];
         foreach ($providers as $providerClass) {
             $provider = GeneralUtility::makeInstance($providerClass, $table, $identifier, $context);
index e60d373..1dfc653 100644 (file)
@@ -183,8 +183,7 @@ class BackendController
     protected function initializeToolbarItems()
     {
         $toolbarItemInstances = [];
-        $classNameRegistry = $GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'];
-        foreach ($classNameRegistry as $className) {
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'] ?? [] as $className) {
             $toolbarItemInstance = GeneralUtility::makeInstance($className);
             if (!$toolbarItemInstance instanceof ToolbarItemInterface) {
                 throw new \RuntimeException(
@@ -796,10 +795,8 @@ class BackendController
     protected function executeHook($identifier, array $hookConfiguration = [])
     {
         $options = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/backend.php'];
-        if (isset($options[$identifier]) && is_array($options[$identifier])) {
-            foreach ($options[$identifier] as $hookFunction) {
-                GeneralUtility::callUserFunction($hookFunction, $hookConfiguration, $this);
-            }
+        foreach ($options[$identifier] ?? [] as $hookFunction) {
+            GeneralUtility::callUserFunction($hookFunction, $hookConfiguration, $this);
         }
     }
 
index c3c9745..df047ed 100644 (file)
@@ -211,15 +211,13 @@ class ElementInformationController
 
         // render type by user func
         $typeRendered = false;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'] as $className) {
-                $typeRenderObj = GeneralUtility::makeInstance($className);
-                if (method_exists($typeRenderObj, 'isValid') && method_exists($typeRenderObj, 'render')) {
-                    if ($typeRenderObj->isValid($this->type, $this)) {
-                        $content .= $typeRenderObj->render($this->type, $this);
-                        $typeRendered = true;
-                        break;
-                    }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'] ?? [] as $className) {
+            $typeRenderObj = GeneralUtility::makeInstance($className);
+            if (is_object($typeRenderObj) && method_exists($typeRenderObj, 'isValid') && method_exists($typeRenderObj, 'render')) {
+                if ($typeRenderObj->isValid($this->type, $this)) {
+                    $content .= $typeRenderObj->render($this->type, $this);
+                    $typeRendered = true;
+                    break;
                 }
             }
         }
index c80ca0c..8d604cb 100644 (file)
@@ -231,17 +231,15 @@ class NewContentElementController
             $wizardItems = $this->wizardArray();
             // Wrapper for wizards
             // Hook for manipulating wizardItems, wrapper, onClickEvent etc.
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof NewContentElementWizardHookInterface) {
-                        throw new \UnexpectedValueException(
-                            $className . ' must implement interface ' . NewContentElementWizardHookInterface::class,
-                            1227834741
-                        );
-                    }
-                    $hookObject->manipulateWizardItems($wizardItems, $this);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof NewContentElementWizardHookInterface) {
+                    throw new \UnexpectedValueException(
+                        $className . ' must implement interface ' . NewContentElementWizardHookInterface::class,
+                        1227834741
+                    );
                 }
+                $hookObject->manipulateWizardItems($wizardItems, $this);
             }
             // Add document inline javascript
             $this->moduleTemplate->addJavaScriptCode(
index 29ee2f1..8429776 100644 (file)
@@ -167,18 +167,13 @@ class EditFileController
 
         $this->getButtons();
         // Hook: before compiling the output
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'])) {
-            $preOutputProcessingHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'];
-            if (is_array($preOutputProcessingHook)) {
-                $hookParameters = [
-                    'content' => &$this->content,
-                    'target' => &$this->target,
-                    'dataColumnDefinition' => &$dataColumnDefinition,
-                ];
-                foreach ($preOutputProcessingHook as $hookFunction) {
-                    GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-                }
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'] ?? [] as $hookFunction) {
+            $hookParameters = [
+                'content' => &$this->content,
+                'target' => &$this->target,
+                'dataColumnDefinition' => &$dataColumnDefinition,
+            ];
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
         }
 
         $assigns = [];
@@ -262,17 +257,12 @@ class EditFileController
         $pageContent = $view->render();
 
         // Hook: after compiling the output
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'])) {
-            $postOutputProcessingHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'];
-            if (is_array($postOutputProcessingHook)) {
-                $hookParameters = [
-                    'pageContent' => &$pageContent,
-                    'target' => &$this->target
-                ];
-                foreach ($postOutputProcessingHook as $hookFunction) {
-                    GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-                }
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'] ?? [] as $hookFunction) {
+            $hookParameters = [
+                'pageContent' => &$pageContent,
+                'target' => &$this->target
+            ];
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
         }
 
         $this->content .= $pageContent;
index 6b38c51..b2d9ad0 100644 (file)
@@ -446,14 +446,10 @@ class LoginController
      */
     protected function validateAndSortLoginProviders()
     {
-        if (
-            !isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'])
-            || empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'])
-        ) {
+        $providers = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'] ?? [];
+        if (empty($providers) || !is_array($providers)) {
             throw new \RuntimeException('No login providers are registered in $GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'backend\'][\'loginProviders\'].', 1433417281);
         }
-        $providers = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'];
         foreach ($providers as $identifier => $configuration) {
             if (empty($configuration) || !is_array($configuration)) {
                 throw new \RuntimeException('Missing configuration for login provider "' . $identifier . '".', 1433416043);
index 07afbae..7e5afa4 100644 (file)
@@ -764,15 +764,12 @@ class PageLayoutController
             $this->makeButtons();
             // @internal: This is an internal hook for compatibility7 only, this hook will be removed without further notice
             if ($this->MOD_SETTINGS['function'] != 1 && $this->MOD_SETTINGS['function'] != 2) {
-                $renderActionHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'];
-                if (is_array($renderActionHook)) {
-                    foreach ($renderActionHook as $hook) {
-                        $params = [
-                            'deleteButton' => $this->deleteButton,
-                            ''
-                        ];
-                        $content .= GeneralUtility::callUserFunction($hook, $params, $this);
-                    }
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'] ?? [] as $hook) {
+                    $params = [
+                        'deleteButton' => $this->deleteButton,
+                        ''
+                    ];
+                    $content .= GeneralUtility::callUserFunction($hook, $params, $this);
                 }
             }
             // Create LanguageMenu
@@ -905,12 +902,9 @@ class PageLayoutController
         // Init the content
         $content = '';
         // Additional header content
-        $headerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'];
-        if (is_array($headerContentHook)) {
-            foreach ($headerContentHook as $hook) {
-                $params = [];
-                $content .= GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'] ?? [] as $hook) {
+            $params = [];
+            $content .= GeneralUtility::callUserFunction($hook, $params, $this);
         }
         // Add the content for each table we have rendered (traversing $tableOutput variable)
         foreach ($tableOutput as $table => $output) {
@@ -928,12 +922,9 @@ class PageLayoutController
             $this->searchContent = $dbList->getSearchBox();
         }
         // Additional footer content
-        $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook'];
-        if (is_array($footerContentHook)) {
-            foreach ($footerContentHook as $hook) {
-                $params = [];
-                $content .= GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook'] ?? [] as $hook) {
+            $params = [];
+            $content .= GeneralUtility::callUserFunction($hook, $params, $this);
         }
         return $content;
     }
index 9745db3..af2b4ea 100644 (file)
@@ -246,17 +246,15 @@ class NewContentElementWizardController
             $wizardItems = $this->getWizardItems();
             // Wrapper for wizards
             // Hook for manipulating wizardItems, wrapper, onClickEvent etc.
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof NewContentElementWizardHookInterface) {
-                        throw new \UnexpectedValueException(
-                            $className . ' must implement interface ' . NewContentElementWizardHookInterface::class,
-                            1496496724
-                        );
-                    }
-                    $hookObject->manipulateWizardItems($wizardItems, $this);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof NewContentElementWizardHookInterface) {
+                    throw new \UnexpectedValueException(
+                        $className . ' must implement interface ' . NewContentElementWizardHookInterface::class,
+                        1496496724
+                    );
                 }
+                $hookObject->manipulateWizardItems($wizardItems, $this);
             }
 
             // Traverse items for the wizard.
index a5bc5ba..e7cafdb 100644 (file)
@@ -631,17 +631,12 @@ class InlineRecordContainer extends AbstractContainer
     protected function initHookObjects()
     {
         $this->hookObjects = [];
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook'])) {
-            $tceformsInlineHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook'];
-            if (is_array($tceformsInlineHook)) {
-                foreach ($tceformsInlineHook as $className) {
-                    $processObject = GeneralUtility::makeInstance($className);
-                    if (!$processObject instanceof InlineElementHookInterface) {
-                        throw new \UnexpectedValueException($className . ' must implement interface ' . InlineElementHookInterface::class, 1202072000);
-                    }
-                    $this->hookObjects[] = $processObject;
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook'] ?? [] as $className) {
+            $processObject = GeneralUtility::makeInstance($className);
+            if (!$processObject instanceof InlineElementHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . InlineElementHookInterface::class, 1202072000);
             }
+            $this->hookObjects[] = $processObject;
         }
     }
 
index 8e30766..812c9ed 100644 (file)
@@ -224,15 +224,13 @@ class ImageManipulationElement extends AbstractFormElement
     {
         $previewUrl = '';
         // Hook to generate a preview URL
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend/Form/Element/ImageManipulationElement']['previewUrl']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend/Form/Element/ImageManipulationElement']['previewUrl'])) {
-            $hookParameters = [
-                'databaseRow' => $databaseRow,
-                'file' => $file,
-                'previewUrl' => $previewUrl,
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend/Form/Element/ImageManipulationElement']['previewUrl'] as $listener) {
-                $previewUrl = GeneralUtility::callUserFunction($listener, $hookParameters, $this);
-            }
+        $hookParameters = [
+            'databaseRow' => $databaseRow,
+            'file' => $file,
+            'previewUrl' => $previewUrl,
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend/Form/Element/ImageManipulationElement']['previewUrl'] ?? [] as $listener) {
+            $previewUrl = GeneralUtility::callUserFunction($listener, $hookParameters, $this);
         }
         return $previewUrl;
     }
index 467db33..8c8f275 100644 (file)
@@ -170,9 +170,7 @@ class DatabaseUserPermissionCheck implements FormDataProviderInterface
             );
         }
 
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck'])
-        ) {
+        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck'] ?? null)) {
             // A hook may modify the $userHasAccess decision. Previous state is saved to see if a hook changed
             // a previous decision from TRUE to FALSE to throw a specific exception in this case
             $userHasAccessBeforeHook = $userHasAccess;
index 7b8e9f5..5bbf3c3 100644 (file)
@@ -166,13 +166,11 @@ class ButtonBar
             ksort($this->buttons[$position]);
         }
         // Hook for manipulating the docHeaderButtons
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook'] as $funcRef) {
-                $params = [
-                    'buttons' => $this->buttons
-                ];
-                $this->buttons = GeneralUtility::callUserFunction($funcRef, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook'] ?? [] as $funcRef) {
+            $params = [
+                'buttons' => $this->buttons
+            ];
+            $this->buttons = GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
         return $this->buttons;
     }
index 9d05214..9e528f6 100644 (file)
@@ -455,16 +455,11 @@ function jumpToUrl(URL) {
     public function startPage($title)
     {
         // hook pre start page
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'])) {
-            $preStartPageHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'];
-            if (is_array($preStartPageHook)) {
-                $hookParameters = [
-                    'title' => &$title
-                ];
-                foreach ($preStartPageHook as $hookFunction) {
-                    GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-                }
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'] ?? [] as $hookFunction) {
+            $hookParameters = [
+                'title' => &$title
+            ];
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
         }
         // alternative template for Header and Footer
         if ($this->pageHeaderFooterTemplateFile) {
@@ -508,16 +503,11 @@ function jumpToUrl(URL) {
         $this->pageRenderer->addJsFile('EXT:core/Resources/Public/JavaScript/Contrib/bootstrap/bootstrap.js');
 
         // hook for additional headerData
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'])) {
-            $preHeaderRenderHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'];
-            if (is_array($preHeaderRenderHook)) {
-                $hookParameters = [
-                    'pageRenderer' => &$this->pageRenderer
-                ];
-                foreach ($preHeaderRenderHook as $hookFunction) {
-                    GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-                }
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'] ?? [] as $hookFunction) {
+            $hookParameters = [
+                'pageRenderer' => &$this->pageRenderer
+            ];
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
         }
         // Construct page header.
         $str = $this->pageRenderer->render(PageRenderer::PART_HEADER);
@@ -796,7 +786,7 @@ function jumpToUrl(URL) {
             }
         }
         // Hook for adding more markers/content to the page, like the version selector
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['moduleBodyPostProcess'])) {
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['moduleBodyPostProcess'] ?? [] as $funcRef) {
             $params = [
                 'moduleTemplateFilename' => &$this->moduleTemplateFilename,
                 'moduleTemplate' => &$this->moduleTemplate,
@@ -804,9 +794,7 @@ function jumpToUrl(URL) {
                 'markers' => &$markerArray,
                 'parentObject' => &$this
             ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['moduleBodyPostProcess'] as $funcRef) {
-                GeneralUtility::callUserFunction($funcRef, $params, $this);
-            }
+            GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
         // Replacing all markers with the finished markers and return the HTML content
         return $this->templateService->substituteMarkerArray($moduleBody, $markerArray, '###|###');
@@ -859,15 +847,13 @@ function jumpToUrl(URL) {
             $markers['BUTTONLIST_' . strtoupper($key)] = str_replace(LF, '', $buttonTemplate);
         }
         // Hook for manipulating docHeaderButtons
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook'])) {
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook'] ?? [] as $funcRef) {
             $params = [
                 'buttons' => $buttons,
                 'markers' => &$markers,
                 'pObj' => &$this
             ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook'] as $funcRef) {
-                GeneralUtility::callUserFunction($funcRef, $params, $this);
-            }
+            GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
         return $markers;
     }
index 551e16d..2e8e5ed 100644 (file)
@@ -336,13 +336,13 @@ class Commands
         }
         // Call stats information hook
         $stat = '';
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
-            $_params = ['pages', $record['uid']];
-            $fakeThis = null;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
-                $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $fakeThis);
-            }
+
+        $_params = ['pages', $record['uid']];
+        $fakeThis = null;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] ?? [] as $_funcRef) {
+            $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $fakeThis);
         }
+
         $prefix .= htmlspecialchars(self::$addIdAsPrefix ? '[' . $record['uid'] . '] ' : '');
         $subNode->setEditableText($text);
         $subNode->setText(htmlspecialchars($visibleText), $field, $prefix, htmlspecialchars($suffix) . $stat);
index e54f036..24490f8 100644 (file)
@@ -69,22 +69,17 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider
      */
     public function __construct($nodeLimit = null)
     {
-        if ($nodeLimit === null) {
-            $nodeLimit = $GLOBALS['TYPO3_CONF_VARS']['BE']['pageTree']['preloadLimit'];
-        }
+        $nodeLimit = $nodeLimit ?? $GLOBALS['TYPO3_CONF_VARS']['BE']['pageTree']['preloadLimit'];
         $this->nodeLimit = abs((int)$nodeLimit);
 
         $this->showRootlineAboveMounts = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPathAboveMounts');
 
         $this->hiddenRecords = GeneralUtility::trimExplode(',', $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages'));
-        $hookElements = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'];
-        if (is_array($hookElements)) {
-            foreach ($hookElements as $className) {
-                /** @var $hookObject \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface */
-                $hookObject = GeneralUtility::makeInstance($className);
-                if ($hookObject instanceof \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface) {
-                    $this->processCollectionHookObjects[] = $hookObject;
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'] ?? [] as $className) {
+            /** @var $hookObject \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface */
+            $hookObject = GeneralUtility::makeInstance($className);
+            if ($hookObject instanceof \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface) {
+                $this->processCollectionHookObjects[] = $hookObject;
             }
         }
     }
index 428fd78..9db93cd 100644 (file)
@@ -1877,13 +1877,11 @@ class BackendUtility
         /*****************
          *HOOK: pre-processing the human readable output from a record
          ****************/
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'])) {
-            // Create NULL-reference
-            $null = null;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $theColConf, $null);
-            }
+        $null = null;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['preProcessValue'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $theColConf, $null);
         }
+
         $l = '';
         $lang = static::getLanguageService();
         switch ((string)$theColConf['type']) {
@@ -2230,16 +2228,13 @@ class BackendUtility
         /*****************
          *HOOK: post-processing the human readable output from a record
          ****************/
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'])) {
-            // Create NULL-reference
-            $null = null;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'] as $_funcRef) {
-                $params = [
-                    'value' => $l,
-                    'colConf' => $theColConf
-                ];
-                $l = GeneralUtility::callUserFunction($_funcRef, $params, $null);
-            }
+        $null = null;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'] ?? [] as $_funcRef) {
+            $params = [
+                'value' => $l,
+                'colConf' => $theColConf
+            ];
+            $l = GeneralUtility::callUserFunction($_funcRef, $params, $null);
         }
         if ($fixed_lgd_chars) {
             return GeneralUtility::fixed_lgd_cs($l, $fixed_lgd_chars);
@@ -2536,23 +2531,18 @@ class BackendUtility
             $viewScript = $alternativeUrl;
         }
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'preProcess')) {
-                    $hookObj->preProcess(
-                        $pageUid,
-                        $backPath,
-                        $rootLine,
-                        $anchorSection,
-                        $viewScript,
-                        $additionalGetVars,
-                        $switchFocus
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'preProcess')) {
+                $hookObj->preProcess(
+                    $pageUid,
+                    $backPath,
+                    $rootLine,
+                    $anchorSection,
+                    $viewScript,
+                    $additionalGetVars,
+                    $switchFocus
+                );
             }
         }
 
@@ -2565,23 +2555,18 @@ class BackendUtility
             $previewUrl = self::createPreviewUrl($pageUid, $rootLine, $anchorSection, $additionalGetVars, $viewScript);
         }
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'postProcess')) {
-                    $previewUrl = $hookObj->postProcess(
-                        $previewUrl,
-                        $pageUid,
-                        $rootLine,
-                        $anchorSection,
-                        $viewScript,
-                        $additionalGetVars,
-                        $switchFocus
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'postProcess')) {
+                $previewUrl = $hookObj->postProcess(
+                    $previewUrl,
+                    $pageUid,
+                    $rootLine,
+                    $anchorSection,
+                    $viewScript,
+                    $additionalGetVars,
+                    $switchFocus
+                );
             }
         }
 
@@ -3031,11 +3016,7 @@ class BackendUtility
             return '';
         }
         // Hook: Allows to let TYPO3 execute your JS code
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['updateSignalHook'])) {
-            $updateSignals = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['updateSignalHook'];
-        } else {
-            $updateSignals = [];
-        }
+        $updateSignals = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['updateSignalHook'] ?? [];
         // Loop through all setUpdateSignals and get the JS code
         foreach ($modData as $set => $val) {
             if (isset($updateSignals[$set])) {
index 2b11155..928fe76 100644 (file)
@@ -1854,15 +1854,12 @@ class PageLayoutView implements LoggerAwareInterface
         }
 
         // Call drawFooter hooks
-        $drawFooterHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawFooter'];
-        if (is_array($drawFooterHooks)) {
-            foreach ($drawFooterHooks as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof PageLayoutViewDrawFooterHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageLayoutViewDrawFooterHookInterface::class, 1404378171);
-                }
-                $hookObject->preProcess($this, $info, $row);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawFooter'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof PageLayoutViewDrawFooterHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . PageLayoutViewDrawFooterHookInterface::class, 1404378171);
             }
+            $hookObject->preProcess($this, $info, $row);
         }
 
         // Display info from records fields:
@@ -1999,12 +1996,11 @@ class PageLayoutView implements LoggerAwareInterface
                 . $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</a>';
         }
         // Call stats information hook
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
-            $_params = ['tt_content', $row['uid'], &$row];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
-                $additionalIcons[] = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['tt_content', $row['uid'], &$row];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] ?? [] as $_funcRef) {
+            $additionalIcons[] = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
+
         // Wrap the whole header
         // NOTE: end-tag for <div class="t3-page-ce-body"> is in getTable_tt_content()
         return '<div class="t3-page-ce-header ' . ($allowDragAndDrop ? 't3-page-ce-header-draggable t3js-page-ce-draghandle' : '') . '">
@@ -2063,15 +2059,12 @@ class PageLayoutView implements LoggerAwareInterface
         $infoArr = [];
         $drawItem = true;
         // Hook: Render an own preview of a record
-        $drawItemHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'];
-        if (is_array($drawItemHooks)) {
-            foreach ($drawItemHooks as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof PageLayoutViewDrawItemHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageLayoutViewDrawItemHookInterface::class, 1218547409);
-                }
-                $hookObject->preProcess($this, $drawItem, $outHeader, $out, $row);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof PageLayoutViewDrawItemHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . PageLayoutViewDrawItemHookInterface::class, 1218547409);
             }
+            $hookObject->preProcess($this, $drawItem, $outHeader, $out, $row);
         }
 
         // If the previous hook did not render something,
@@ -2169,18 +2162,14 @@ class PageLayoutView implements LoggerAwareInterface
                     }
                     break;
                 case 'list':
-                    $hookArr = [];
                     $hookOut = '';
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$row['list_type']])) {
-                        $hookArr = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$row['list_type']];
-                    } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'])) {
-                        $hookArr = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'];
-                    }
-                    if (!empty($hookArr)) {
-                        $_params = ['pObj' => &$this, 'row' => $row, 'infoArr' => $infoArr];
-                        foreach ($hookArr as $_funcRef) {
-                            $hookOut .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                        }
+                    $_params = ['pObj' => &$this, 'row' => $row, 'infoArr' => $infoArr];
+                    foreach (
+                        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$row['list_type']] ??
+                        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'] ??
+                        [] as $_funcRef
+                    ) {
+                        $hookOut .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
                     }
                     if ((string)$hookOut !== '') {
                         $out .= $hookOut;
@@ -3372,20 +3361,18 @@ class PageLayoutView implements LoggerAwareInterface
         }
 
         $hookName = DatabaseRecordList::class;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObject, 'buildQueryParametersPostProcess')) {
-                    $hookObject->buildQueryParametersPostProcess(
-                        $parameters,
-                        $table,
-                        $pageId,
-                        $additionalConstraints,
-                        $fieldList,
-                        $this,
-                        $queryBuilder
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObject, 'buildQueryParametersPostProcess')) {
+                $hookObject->buildQueryParametersPostProcess(
+                    $parameters,
+                    $table,
+                    $pageId,
+                    $additionalConstraints,
+                    $fieldList,
+                    $this,
+                    $queryBuilder
+                );
             }
         }
 
@@ -3575,16 +3562,14 @@ class PageLayoutView implements LoggerAwareInterface
             $fieldListWasSet = true;
         }
         // Call hook to add or change the list
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['mod_list']['getSearchFieldList'])) {
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['mod_list']['getSearchFieldList'] ?? [] as $hookFunction) {
             $hookParameters = [
                 'tableHasSearchConfiguration' => $fieldListWasSet,
                 'tableName' => $tableName,
                 'searchFields' => &$fieldArray,
                 'searchString' => $this->searchString
             ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['mod_list']['getSearchFieldList'] as $hookFunction) {
-                GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-            }
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
         }
         return $fieldArray;
     }
index 873f4bc..a434995 100644 (file)
@@ -81,11 +81,9 @@ class PageTreeView extends BrowseTreeView
         }
         // Call stats information hook
         $stat = '';
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
-            $_params = ['pages', $row['uid']];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
-                $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pages', $row['uid']];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] ?? [] as $_funcRef) {
+            $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return $dragDropIcon . $lockIcon . $pageIdStr . $stat;
     }
@@ -102,13 +100,12 @@ class PageTreeView extends BrowseTreeView
     public function wrapTitle($title, $row, $bank = 0)
     {
         // Hook for overriding the page title
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.webpagetree.php']['pageTitleOverlay'])) {
-            $_params = ['title' => &$title, 'row' => &$row];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.webpagetree.php']['pageTitleOverlay'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
-            unset($_params);
+
+        $_params = ['title' => &$title, 'row' => &$row];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.webpagetree.php']['pageTitleOverlay'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
+
         $aOnClick = 'return jumpTo(' . GeneralUtility::quoteJSvalue($this->getJumpToParam($row)) . ',this,' . GeneralUtility::quoteJSvalue($this->domIdPrefix . $this->getId($row)) . ',' . $bank . ');';
         $clickMenuParts = BackendUtility::wrapClickMenuOnIcon('', 'pages', $row['uid'], 'tree', '', '', true);
 
index 7095c8d..3e533bc 100644 (file)
@@ -430,13 +430,11 @@ abstract class AbstractUserAuthentication implements LoggerAwareInterface
             $this->setSessionCookie();
         }
         // Hook for alternative ways of filling the $this->user array (is used by the "timtaw" extension)
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postUserLookUp'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postUserLookUp'] as $funcName) {
-                $_params = [
-                    'pObj' => $this,
-                ];
-                GeneralUtility::callUserFunction($funcName, $_params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postUserLookUp'] ?? [] as $funcName) {
+            $_params = [
+                'pObj' => $this,
+            ];
+            GeneralUtility::callUserFunction($funcName, $_params, $this);
         }
         // Set $this->gc_time if not explicitly specified
         if ($this->gc_time === 0) {
@@ -796,16 +794,15 @@ abstract class AbstractUserAuthentication implements LoggerAwareInterface
             );
 
             // Hook to implement login failure tracking methods
-            if (
-                !empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postLoginFailureProcessing'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postLoginFailureProcessing'])
-            ) {
-                $_params = [];
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postLoginFailureProcessing'] as $_funcRef) {
-                    GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
-            } else {
-                // If no hook is implemented, wait for 5 seconds
+            $_params = [];
+            $sleep = true;
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postLoginFailureProcessing'] ?? [] as $_funcRef) {
+                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
+                $sleep = false;
+            }
+
+            if ($sleep) {
+                // No hooks were triggered - default login failure behavior is to sleep 5 seconds
                 sleep(5);
             }
 
@@ -998,21 +995,18 @@ abstract class AbstractUserAuthentication implements LoggerAwareInterface
         $this->logger->debug('logoff: ses_id = ' . $this->id);
         // Release the locked records
         BackendUtility::lockRecords();
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'])) {
-            $_params = [];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'] as $_funcRef) {
-                if ($_funcRef) {
-                    GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+
+        $_params = [];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'] ?? [] as $_funcRef) {
+            if ($_funcRef) {
+                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
         }
         $this->performLogoff();
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'])) {
-            $_params = [];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'] as $_funcRef) {
-                if ($_funcRef) {
-                    GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'] ?? [] as $_funcRef) {
+            if ($_funcRef) {
+                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
         }
     }
index a125cc5..d74411f 100644 (file)
@@ -145,17 +145,15 @@ class AuthenticationService extends AbstractAuthenticationService
         $groupDataArr = [];
         if ($this->mode === 'getGroupsFE') {
             $groups = [];
-            if (is_array($user) && $user[$this->db_user['usergroup_column']]) {
+            if ($user[$this->db_user['usergroup_column']] ?? false) {
                 $groupList = $user[$this->db_user['usergroup_column']];
                 $groups = [];
                 $this->getSubGroups($groupList, '', $groups);
             }
             // ADD group-numbers if the IPmask matches.
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['FE']['IPmaskMountGroups'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['FE']['IPmaskMountGroups'] as $IPel) {
-                    if ($this->authInfo['REMOTE_ADDR'] && $IPel[0] && GeneralUtility::cmpIP($this->authInfo['REMOTE_ADDR'], $IPel[0])) {
-                        $groups[] = (int)$IPel[1];
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['FE']['IPmaskMountGroups'] ?? [] as $IPel) {
+                if ($this->authInfo['REMOTE_ADDR'] && $IPel[0] && GeneralUtility::cmpIP($this->authInfo['REMOTE_ADDR'], $IPel[0])) {
+                    $groups[] = (int)$IPel[1];
                 }
             }
             $groups = array_unique($groups);
index ad74bda..f708abc 100644 (file)
@@ -553,11 +553,9 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             // ****************
             // getPagePermsClause-HOOK
             // ****************
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'] as $_funcRef) {
-                    $_params = ['currentClause' => $constraint, 'perms' => $perms];
-                    $constraint = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'] ?? [] as $_funcRef) {
+                $_params = ['currentClause' => $constraint, 'perms' => $perms];
+                $constraint = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
             return $constraint;
         }
@@ -600,14 +598,12 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         // ****************
         // CALCPERMS hook
         // ****************
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms'] as $_funcRef) {
-                $_params = [
-                    'row' => $row,
-                    'outputPermissions' => $out
-                ];
-                $out = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms'] ?? [] as $_funcRef) {
+            $_params = [
+                'row' => $row,
+                'outputPermissions' => $out
+            ];
+            $out = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return $out;
     }
@@ -857,16 +853,14 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         // Checking record permissions
         // THIS is where we can include a check for "perms_" fields for other records than pages...
         // Process any hooks
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['recordEditAccessInternals'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['recordEditAccessInternals'] as $funcRef) {
-                $params = [
-                    'table' => $table,
-                    'idOrRow' => $idOrRow,
-                    'newRecord' => $newRecord
-                ];
-                if (!GeneralUtility::callUserFunction($funcRef, $params, $this)) {
-                    return false;
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['recordEditAccessInternals'] ?? [] as $funcRef) {
+            $params = [
+                'table' => $table,
+                'idOrRow' => $idOrRow,
+                'newRecord' => $newRecord
+            ];
+            if (!GeneralUtility::callUserFunction($funcRef, $params, $this)) {
+                return false;
             }
         }
         // Finally, return TRUE if all is well.
@@ -1477,12 +1471,10 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             )
         );
         // Hook for manipulation of the WHERE sql sentence which controls which BE-groups are included
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroupQuery'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroupQuery'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'fetchGroupQuery_processQuery')) {
-                    $constraints = $hookObj->fetchGroupQuery_processQuery($this, $grList, $idList, (string)$constraints);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroupQuery'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'fetchGroupQuery_processQuery')) {
+                $constraints = $hookObj->fetchGroupQuery_processQuery($this, $grList, $idList, (string)$constraints);
             }
         }
         $res = $queryBuilder->select('*')
@@ -1537,11 +1529,9 @@ class BackendUserAuthentication extends AbstractUserAuthentication
             }
         }
         // HOOK: fetchGroups_postProcessing
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroups_postProcessing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroups_postProcessing'] as $_funcRef) {
-                $_params = [];
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['fetchGroups_postProcessing'] ?? [] as $_funcRef) {
+            $_params = [];
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -1974,16 +1964,14 @@ class BackendUserAuthentication extends AbstractUserAuthentication
         }
 
         // HOOK: getDefaultUploadFolder
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder'] as $_funcRef) {
-                $_params = [
-                    'uploadFolder' => $uploadFolder,
-                    'pid' => $pid,
-                    'table' => $table,
-                    'field' => $field,
-                ];
-                $uploadFolder = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder'] ?? [] as $_funcRef) {
+            $_params = [
+                'uploadFolder' => $uploadFolder,
+                'pid' => $pid,
+                'table' => $table,
+                'field' => $field,
+            ];
+            $uploadFolder = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
 
         if ($uploadFolder instanceof \TYPO3\CMS\Core\Resource\Folder) {
index 6a72b59..69e0fec 100644 (file)
@@ -150,12 +150,12 @@ abstract class AbstractFrontend implements FrontendInterface
         if (!$this->isValidTag($tag)) {
             throw new \InvalidArgumentException('"' . $tag . '" is not a valid tag for a cache entry.', 1233057359);
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'] as $_funcRef) {
-                $params = ['tag' => $tag];
-                GeneralUtility::callUserFunction($_funcRef, $params, $this);
-            }
+
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'] ?? [] as $_funcRef) {
+            $params = ['tag' => $tag];
+            GeneralUtility::callUserFunction($_funcRef, $params, $this);
         }
+
         if ($this->backend instanceof TaggableBackendInterface) {
             $this->backend->flushByTag($tag);
         }
index bcb921d..13f67f7 100644 (file)
@@ -46,16 +46,15 @@ class VariableFrontend extends AbstractFrontend
                 throw new \InvalidArgumentException('"' . $tag . '" is not a valid tag for a cache entry.', 1233058269);
             }
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php']['set'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php']['set'] as $_funcRef) {
-                $params = [
-                    'entryIdentifier' => &$entryIdentifier,
-                    'variable' => &$variable,
-                    'tags' => &$tags,
-                    'lifetime' => &$lifetime
-                ];
-                GeneralUtility::callUserFunction($_funcRef, $params, $this);
-            }
+
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php']['set'] ?? [] as $_funcRef) {
+            $params = [
+                'entryIdentifier' => &$entryIdentifier,
+                'variable' => &$variable,
+                'tags' => &$tags,
+                'lifetime' => &$lifetime
+            ];
+            GeneralUtility::callUserFunction($_funcRef, $params, $this);
         }
         if (!$this->backend instanceof TransientBackendInterface) {
             $variable = serialize($variable);
index 18a89a7..4cc26c9 100644 (file)
@@ -596,26 +596,21 @@ class FlexFormTools
         // Result of the FIRST hook that gives an non-empty string is used, namespace your identifiers in
         // a way that there is little chance they overlap (eg. prefix with extension name).
         // If implemented, this hook should be paired with a hook in getDataStructureIdentifier() above.
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'])
-        ) {
-            $hookClasses = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'];
-            foreach ($hookClasses as $hookClass) {
-                $hookInstance = GeneralUtility::makeInstance($hookClass);
-                if (method_exists($hookClass, 'parseDataStructureByIdentifierPreProcess')) {
-                    $dataStructure = $hookInstance->parseDataStructureByIdentifierPreProcess($identifier);
-                    if (!is_string($dataStructure) && !is_array($dataStructure)) {
-                        // Programming error -> not catchable
-                        throw new \RuntimeException(
-                            'Hook class ' . $hookClass . ' method parseDataStructureByIdentifierPreProcess must either'
-                            . ' return an empty string or a data structure string or a parsed data structure array.',
-                            1478168512
-                        );
-                    }
-                    if (!empty($dataStructure)) {
-                        // Early break if a hook resolved to something!
-                        break;
-                    }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'] ?? [] as $hookClass) {
+            $hookInstance = GeneralUtility::makeInstance($hookClass);
+            if (method_exists($hookClass, 'parseDataStructureByIdentifierPreProcess')) {
+                $dataStructure = $hookInstance->parseDataStructureByIdentifierPreProcess($identifier);
+                if (!is_string($dataStructure) && !is_array($dataStructure)) {
+                    // Programming error -> not catchable
+                    throw new \RuntimeException(
+                        'Hook class ' . $hookClass . ' method parseDataStructureByIdentifierPreProcess must either'
+                        . ' return an empty string or a data structure string or a parsed data structure array.',
+                        1478168512
+                    );
+                }
+                if (!empty($dataStructure)) {
+                    // Early break if a hook resolved to something!
+                    break;
                 }
             }
         }
@@ -733,21 +728,16 @@ class FlexFormTools
         // Hook to manipulate data structure further. This can be used to add or remove fields
         // from given structure. Multiple hooks can be registered, all are called. They
         // receive the parsed structure and the identifier array.
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'])
-        ) {
-            $hookClasses = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'];
-            foreach ($hookClasses as $hookClass) {
-                $hookInstance = GeneralUtility::makeInstance($hookClass);
-                if (method_exists($hookClass, 'parseDataStructureByIdentifierPostProcess')) {
-                    $dataStructure = $hookInstance->parseDataStructureByIdentifierPostProcess($dataStructure, $identifier);
-                    if (!is_array($dataStructure)) {
-                        // Programming error -> not catchable
-                        throw new \RuntimeException(
-                            'Hook class ' . $hookClass . ' method parseDataStructureByIdentifierPreProcess must return and array.',
-                            1478350806
-                        );
-                    }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['flexParsing'] ?? [] as $hookClass) {
+            $hookInstance = GeneralUtility::makeInstance($hookClass);
+            if (method_exists($hookClass, 'parseDataStructureByIdentifierPostProcess')) {
+                $dataStructure = $hookInstance->parseDataStructureByIdentifierPostProcess($dataStructure, $identifier);
+                if (!is_array($dataStructure)) {
+                    // Programming error -> not catchable
+                    throw new \RuntimeException(
+                        'Hook class ' . $hookClass . ' method parseDataStructureByIdentifierPreProcess must return and array.',
+                        1478350806
+                    );
                 }
             }
         }
index aa4fd11..ebaa9f6 100644 (file)
@@ -77,14 +77,12 @@ class FileDumpController
             }
 
             // Hook: allow some other process to do some security/access checks. Hook should issue 403 if access is rejected
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof FileDumpEIDHookInterface) {
-                        throw new \UnexpectedValueException($className . ' must implement interface ' . FileDumpEIDHookInterface::class, 1394442417);
-                    }
-                    $hookObject->checkFileAccess($file);
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof FileDumpEIDHookInterface) {
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . FileDumpEIDHookInterface::class, 1394442417);
                 }
+                $hookObject->checkFileAccess($file);
             }
             $file->getStorage()->dumpFileContents($file);
             // @todo Refactor FAL to not echo directly, but to implement a stream for output here and use response
index 9bade08..25c542d 100644 (file)
@@ -464,10 +464,11 @@ class Bootstrap
      */
     protected function initializeRuntimeActivatedPackagesFromConfiguration()
     {
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'])) {
+        $packages = $GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'] ?? [];
+        if (!empty($packages)) {
             /** @var \TYPO3\CMS\Core\Package\PackageManager $packageManager */
             $packageManager = $this->getEarlyInstance(\TYPO3\CMS\Core\Package\PackageManager::class);
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'] as $runtimeAddedPackageKey) {
+            foreach ($packages as $runtimeAddedPackageKey) {
                 $packageManager->activatePackageDuringRuntime($runtimeAddedPackageKey);
             }
         }
@@ -809,18 +810,16 @@ class Bootstrap
      */
     protected function runExtTablesPostProcessingHooks()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'] as $className) {
-                /** @var $hookObject \TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface */
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof \TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface) {
-                    throw new \UnexpectedValueException(
-                        '$hookObject "' . $className . '" must implement interface TYPO3\\CMS\\Core\\Database\\TableConfigurationPostProcessingHookInterface',
-                        1320585902
-                    );
-                }
-                $hookObject->processData();
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'] ?? [] as $className) {
+            /** @var $hookObject \TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface */
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof \TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface) {
+                throw new \UnexpectedValueException(
+                    '$hookObject "' . $className . '" must implement interface TYPO3\\CMS\\Core\\Database\\TableConfigurationPostProcessingHookInterface',
+                    1320585902
+                );
             }
+            $hookObject->processData();
         }
     }
 
@@ -964,11 +963,7 @@ class Bootstrap
      */
     public function sendHttpHeaders()
     {
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers']) && is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers'] as $header) {
-                header($header);
-            }
-        }
+        array_map('header', $GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers'] ?? []);
         return $this;
     }
 
index cb00b02..4e889f4 100644 (file)
@@ -910,14 +910,12 @@ class DataHandler implements LoggerAwareInterface
     {
         if (!isset($this->checkModifyAccessListHookObjects)) {
             $this->checkModifyAccessListHookObjects = [];
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof DataHandlerCheckModifyAccessListHookInterface) {
-                        throw new \UnexpectedValueException($className . ' must implement interface ' . DataHandlerCheckModifyAccessListHookInterface::class, 1251892472);
-                    }
-                    $this->checkModifyAccessListHookObjects[] = $hookObject;
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof DataHandlerCheckModifyAccessListHookInterface) {
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . DataHandlerCheckModifyAccessListHookInterface::class, 1251892472);
                 }
+                $this->checkModifyAccessListHookObjects[] = $hookObject;
             }
         }
         return $this->checkModifyAccessListHookObjects;
@@ -949,14 +947,12 @@ class DataHandler implements LoggerAwareInterface
         }
         // First prepare user defined objects (if any) for hooks which extend this function:
         $hookObjectsArr = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObject, 'processDatamap_beforeStart')) {
-                    $hookObject->processDatamap_beforeStart($this);
-                }
-                $hookObjectsArr[] = $hookObject;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObject, 'processDatamap_beforeStart')) {
+                $hookObject->processDatamap_beforeStart($this);
             }
+            $hookObjectsArr[] = $hookObject;
         }
         // Pre-process data-map and synchronize localization states
         $this->datamap = DataMapProcessor::instance($this->datamap, $this->BE_USER)->process();
@@ -2263,14 +2259,12 @@ class DataHandler implements LoggerAwareInterface
                                     if ($theDestFile) {
                                         GeneralUtility::upload_copy_move($theFile, $theDestFile);
                                         // Hook for post-processing the upload action
-                                        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processUpload'])) {
-                                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processUpload'] as $className) {
-                                                $hookObject = GeneralUtility::makeInstance($className);
-                                                if (!$hookObject instanceof DataHandlerProcessUploadHookInterface) {
-                                                    throw new \UnexpectedValueException($className . ' must implement interface ' . DataHandlerProcessUploadHookInterface::class, 1279962349);
-                                                }
-                                                $hookObject->processUpload_postProcessAction($theDestFile, $this);
+                                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processUpload'] ?? [] as $className) {
+                                            $hookObject = GeneralUtility::makeInstance($className);
+                                            if (!$hookObject instanceof DataHandlerProcessUploadHookInterface) {
+                                                throw new \UnexpectedValueException($className . ' must implement interface ' . DataHandlerProcessUploadHookInterface::class, 1279962349);
                                             }
+                                            $hookObject->processUpload_postProcessAction($theDestFile, $this);
                                         }
                                         $this->copiedFileMap[$theFile] = $theDestFile;
                                         clearstatcache();
@@ -2454,12 +2448,10 @@ class DataHandler implements LoggerAwareInterface
             // (provided that the current value was already stored IN the charset that the new value is converted to).
             $arrValue = GeneralUtility::xml2array($xmlValue);
 
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (method_exists($hookObject, 'checkFlexFormValue_beforeMerge')) {
-                        $hookObject->checkFlexFormValue_beforeMerge($this, $currentValueArray, $arrValue);
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (method_exists($hookObject, 'checkFlexFormValue_beforeMerge')) {
+                    $hookObject->checkFlexFormValue_beforeMerge($this, $currentValueArray, $arrValue);
                 }
             }
 
@@ -3237,14 +3229,12 @@ class DataHandler implements LoggerAwareInterface
         }
         // Hook initialization:
         $hookObjectsArr = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'processCmdmap_beforeStart')) {
-                    $hookObj->processCmdmap_beforeStart($this);
-                }
-                $hookObjectsArr[] = $hookObj;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'processCmdmap_beforeStart')) {
+                $hookObj->processCmdmap_beforeStart($this);
             }
+            $hookObjectsArr[] = $hookObj;
         }
         $pasteDatamap = [];
         // Traverse command map:
@@ -4381,12 +4371,10 @@ class DataHandler implements LoggerAwareInterface
 
         $recordWasMoved = false;
         // Move the record via a hook, used e.g. for versioning
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'moveRecord')) {
-                    $hookObj->moveRecord($table, $uid, $destPid, $propArr, $moveRec, $resolvedPid, $recordWasMoved, $this);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'moveRecord')) {
+                $hookObj->moveRecord($table, $uid, $destPid, $propArr, $moveRec, $resolvedPid, $recordWasMoved, $this);
             }
         }
         // Move the record if a hook hasn't moved it yet
@@ -4420,10 +4408,8 @@ class DataHandler implements LoggerAwareInterface
         $moveRec = $this->getRecordProperties($table, $uid, true);
         // Prepare user defined objects (if any) for hooks which extend this function:
         $hookObjectsArr = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $className) {
-                $hookObjectsArr[] = GeneralUtility::makeInstance($className);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] ?? [] as $className) {
+            $hookObjectsArr[] = GeneralUtility::makeInstance($className);
         }
         // Timestamp field:
         $updateFields = [];
@@ -4786,12 +4772,11 @@ class DataHandler implements LoggerAwareInterface
                         $translateToMsg = $this->getLanguageService()->sL($TSConfig['translateToMessage']);
                         $translateToMsg = @sprintf($translateToMsg, $langRec['title']);
                     }
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'] as $className) {
-                            $hookObj = GeneralUtility::makeInstance($className);
-                            if (method_exists($hookObj, 'processTranslateTo_copyAction')) {
-                                $hookObj->processTranslateTo_copyAction($row[$fN], $langRec, $this);
-                            }
+
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processTranslateToClass'] ?? [] as $className) {
+                        $hookObj = GeneralUtility::makeInstance($className);
+                        if (method_exists($hookObj, 'processTranslateTo_copyAction')) {
+                            $hookObj->processTranslateTo_copyAction($row[$fN], $langRec, $this);
                         }
                     }
                     if (!empty($translateToMsg)) {
@@ -5010,12 +4995,10 @@ class DataHandler implements LoggerAwareInterface
         // Record asked to be deleted was found:
         if (is_array($recordToDelete)) {
             $recordWasDeleted = false;
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] as $className) {
-                    $hookObj = GeneralUtility::makeInstance($className);
-                    if (method_exists($hookObj, 'processCmdmap_deleteAction')) {
-                        $hookObj->processCmdmap_deleteAction($table, $id, $recordToDelete, $recordWasDeleted, $this);
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] ?? [] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
+                if (method_exists($hookObj, 'processCmdmap_deleteAction')) {
+                    $hookObj->processCmdmap_deleteAction($table, $id, $recordToDelete, $recordWasDeleted, $this);
                 }
             }
             // Delete the record if a hook hasn't deleted it yet
@@ -8499,12 +8482,10 @@ class DataHandler implements LoggerAwareInterface
                 $pageIdsThatNeedCacheFlush[] = $pageUid = (int)$this->getPID($table, $uid);
             }
             // Call pre-processing function for clearing of cache for page ids:
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
-                    $_params = ['pageIdArray' => &$pageIdsThatNeedCacheFlush, 'table' => $table, 'uid' => $uid, 'functionID' => 'clear_cache()'];
-                    // Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
-                    GeneralUtility::callUserFunction($funcName, $_params, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] ?? [] as $funcName) {
+                $_params = ['pageIdArray' => &$pageIdsThatNeedCacheFlush, 'table' => $table, 'uid' => $uid, 'functionID' => 'clear_cache()'];
+                // Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
+                GeneralUtility::callUserFunction($funcName, $_params, $this);
             }
             // Delete cache for selected pages:
             foreach ($pageIdsThatNeedCacheFlush as $pageId) {
@@ -8525,11 +8506,9 @@ class DataHandler implements LoggerAwareInterface
             $clearCacheCommands = array_unique($commands);
         }
         // Call post processing function for clear-cache:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'])) {
-            $_params = ['table' => $table, 'uid' => $uid, 'uid_page' => $pageUid, 'TSConfig' => $TSConfig];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['table' => $table, 'uid' => $uid, 'uid_page' => $pageUid, 'TSConfig' => $TSConfig];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return [
             $tagsToClear,
@@ -8618,12 +8597,10 @@ class DataHandler implements LoggerAwareInterface
         if (MathUtility::canBeInterpretedAsInteger($cacheCmd)) {
             $list_cache = [$cacheCmd];
             // Call pre-processing function for clearing of cache for page ids:
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
-                    $_params = ['pageIdArray' => &$list_cache, 'cacheCmd' => $cacheCmd, 'functionID' => 'clear_cacheCmd()'];
-                    // Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
-                    GeneralUtility::callUserFunction($funcName, $_params, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] ?? [] as $funcName) {
+                $_params = ['pageIdArray' => &$list_cache, 'cacheCmd' => $cacheCmd, 'functionID' => 'clear_cacheCmd()'];
+                // Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
+                GeneralUtility::callUserFunction($funcName, $_params, $this);
             }
             // Delete cache for selected pages:
             if (is_array($list_cache)) {
@@ -8643,11 +8620,9 @@ class DataHandler implements LoggerAwareInterface
         }
 
         // Call post processing function for clear-cache:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'])) {
-            $_params = ['cacheCmd' => strtolower($cacheCmd)];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['cacheCmd' => strtolower($cacheCmd)];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
index e501a3b..71e65f0 100644 (file)
@@ -90,16 +90,14 @@ class ConnectionPool
             return static::$connections[$connectionName];
         }
 
-        if (empty($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][$connectionName])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][$connectionName])
-        ) {
+        $connectionParams = $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][$connectionName] ?? [];
+        if (empty($connectionParams)) {
             throw new \RuntimeException(
                 'The requested database connection named "' . $connectionName . '" has not been configured.',
                 1459422492
             );
         }
 
-        $connectionParams = $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][$connectionName];
         if (empty($connectionParams['wrapperClass'])) {
             $connectionParams['wrapperClass'] = Connection::class;
         }
index becf823..54f001d 100644 (file)
@@ -397,9 +397,7 @@ class QueryView
     public function queryMaker()
     {
         $output = '';
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'])) {
-            $this->hookArray = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'];
-        }
+        $this->hookArray = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'] ?? [];
         $msg = $this->procesStoreControl();
         if (!$this->backendUserAuthentication->userTS['mod.']['dbint.']['disableStoreControl']) {
             $output .= '<h2>Load/Save Query</h2>';
index 226d81b..545a8a7 100644 (file)
@@ -282,13 +282,8 @@ class ConnectionMigrator
 
         // If there are no mapped tables return a SchemaDiff without any changes
         // to avoid update suggestions for tables not related to TYPO3.
-        if (empty($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'])
-        ) {
-            /** @var SchemaDiff $schemaDiff */
-            $schemaDiff = GeneralUtility::makeInstance(SchemaDiff::class, [], [], [], $fromSchema);
-
-            return $schemaDiff;
+        if (empty($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'] ?? null)) {
+            return GeneralUtility::makeInstance(SchemaDiff::class, [], [], [], $fromSchema);
         }
 
         // Collect the table names that have been mapped to this connection.
index 65a155e..eb6e6f6 100644 (file)
@@ -35,9 +35,7 @@ class ExtDirectApi
      */
     public function __construct()
     {
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
-            $this->settings = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'];
-        }
+        $this->settings = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] ?? [];
     }
 
     /**
index 310720c..9ba8fe1 100644 (file)
@@ -117,10 +117,7 @@ class ExtDirectRouter
     protected function processRpc($singleRequest, $namespace)
     {
         $endpointName = $namespace . '.' . $singleRequest->action;
-        if (
-            !isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName])
-        ) {
+        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName] ?? null)) {
             throw new \UnexpectedValueException('ExtDirect: Call to undefined endpoint: ' . $endpointName, 1294586450);
         }
         if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName]['callbackClass'])) {
index dcc2416..6d2ed4a 100644 (file)
@@ -206,11 +206,9 @@ class FrontendEditingController
         }
         if ($cmd === 'save' || $cmd && $table && $uid && isset($GLOBALS['TCA'][$table])) {
             // Hook for defining custom editing actions. Naming is incorrect, but preserves compatibility.
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['extEditAction'])) {
-                $_params = [];
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['extEditAction'] as $_funcRef) {
-                    GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+            $_params = [];
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['extEditAction'] ?? [] as $_funcRef) {
+                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
             // Perform the requested editing command.
             $cmdAction = 'do' . ucwords($cmd);
index d461e44..af9a562 100644 (file)
@@ -542,25 +542,24 @@ class RteHtmlParser extends HtmlParser implements LoggerAwareInterface
                 $linkService = GeneralUtility::makeInstance(LinkService::class);
                 $linkInformation = $linkService->resolve($tagAttributes['href'] ?? '');
 
-                // Modify parameters, this hook should be deprecated
-                if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'])
-                    && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'])) {
-                    $parameters = [
-                        'currentBlock' => $v,
-                        'linkInformation' => $linkInformation,
-                        'url' => $linkInformation['href'],
-                        'attributes' => $tagAttributes
-                    ];
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'] as $className) {
-                        $processor = GeneralUtility::makeInstance($className);
-                        $blockSplit[$k] = $processor->modifyParamsLinksDb($parameters, $this);
-                    }
-                } else {
-                    // Otherwise store the link as <a> tag as default by TYPO3, with the new link service syntax
-                    $tagAttributes['href'] = $linkService->asString($linkInformation);
-                    $blockSplit[$k] = '<a ' . GeneralUtility::implodeAttributes($tagAttributes, true) . '>'
-                        . $this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])) . '</a>';
+                $tagAttributes['href'] = $linkService->asString($linkInformation);
+                $blockSplit[$k] = '<a ' . GeneralUtility::implodeAttributes($tagAttributes, true) . '>'
+                    . $this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])) . '</a>';
+                $parameters = [
+                    'currentBlock' => $v,
+                    'linkInformation' => $linkInformation,
+                    'url' => $linkInformation['href'],
+                    'attributes' => $tagAttributes
+                ];
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'] ?? [] as $className) {
+                    $processor = GeneralUtility::makeInstance($className);
+                    $blockSplit[$k] = $processor->modifyParamsLinksDb($parameters, $this);
                 }
+
+                // Otherwise store the link as <a> tag as default by TYPO3, with the new link service syntax
+                $tagAttributes['href'] = $linkService->asString($linkInformation);
+                $blockSplit[$k] = '<a ' . GeneralUtility::implodeAttributes($tagAttributes, true) . '>'
+                    . $this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])) . '</a>';
             }
         }
         return implode('', $blockSplit);
@@ -599,7 +598,7 @@ class RteHtmlParser extends HtmlParser implements LoggerAwareInterface
                 }
 
                 // Modify parameters by a hook
-                if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc'])) {
+                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc'] ?? false)) {
                     // backwards-compatibility: show an error message if the page is not found
                     $error = '';
                     if ($linkInformation['type'] === LinkService::TYPE_PAGE) {
index 4b9994b..fdd5e17 100644 (file)
@@ -323,13 +323,10 @@ class IconFactory
         }
 
         // Hook to define an alternative iconName
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['overrideIconOverlay'])) {
-            $hookObjects = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['overrideIconOverlay'];
-            foreach ($hookObjects as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObject, 'postOverlayPriorityLookup')) {
-                    $iconName = $hookObject->postOverlayPriorityLookup($table, $row, $status, $iconName);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['overrideIconOverlay'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObject, 'postOverlayPriorityLookup')) {
+                $iconName = $hookObject->postOverlayPriorityLookup($table, $row, $status, $iconName);
             }
         }
 
index bdbab8e..f083eca 100644 (file)
@@ -137,11 +137,9 @@ class Locales implements \TYPO3\CMS\Core\SingletonInterface
         $instance = GeneralUtility::makeInstance(self::class);
         $instance->isoMapping = array_flip($instance->isoReverseMapping);
         // Allow user-defined locales
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] as $locale => $name) {
-                if (!isset($instance->languages[$locale])) {
-                    $instance->languages[$locale] = $name;
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] ?? [] as $locale => $name) {
+            if (!isset($instance->languages[$locale])) {
+                $instance->languages[$locale] = $name;
             }
         }
         // Initializes the locale dependencies with TYPO3 supported locales
@@ -152,9 +150,7 @@ class Locales implements \TYPO3\CMS\Core\SingletonInterface
             }
         }
         // Merge user-provided locale dependencies
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies'])) {
-            ArrayUtility::mergeRecursiveWithOverrule($instance->localeDependencies, $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']);
-        }
+        ArrayUtility::mergeRecursiveWithOverrule($instance->localeDependencies, $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies'] ?? []);
     }
 
     /**
index 713dffe..ef2f827 100644 (file)
@@ -1621,7 +1621,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
         }
 
         // check if additional AMD modules need to be loaded if a single AMD module is initialized
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules'])) {
+        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules'] ?? false)) {
             $this->addInlineSettingArray(
                 'RequireJS.PostInitializationModules',
                 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules']
@@ -2802,23 +2802,25 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function executePreRenderHook()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'])) {
-            $params = [
-                'jsLibs' => &$this->jsLibs,
-                'jsFooterLibs' => &$this->jsFooterLibs,
-                'jsFiles' => &$this->jsFiles,
-                'jsFooterFiles' => &$this->jsFooterFiles,
-                'cssLibs' => &$this->cssLibs,
-                'cssFiles' => &$this->cssFiles,
-                'headerData' => &$this->headerData,
-                'footerData' => &$this->footerData,
-                'jsInline' => &$this->jsInline,
-                'jsFooterInline' => &$this->jsFooterInline,
-                'cssInline' => &$this->cssInline
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'] as $hook) {
-                GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        $hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'] ?? false;
+        if (!$hooks) {
+            return;
+        }
+        $params = [
+            'jsLibs' => &$this->jsLibs,
+            'jsFooterLibs' => &$this->jsFooterLibs,
+            'jsFiles' => &$this->jsFiles,
+            'jsFooterFiles' => &$this->jsFooterFiles,
+            'cssLibs' => &$this->cssLibs,
+            'cssFiles' => &$this->cssFiles,
+            'headerData' => &$this->headerData,
+            'footerData' => &$this->footerData,
+            'jsInline' => &$this->jsInline,
+            'jsFooterInline' => &$this->jsFooterInline,
+            'cssInline' => &$this->cssInline
+        ];
+        foreach ($hooks as $hook) {
+            GeneralUtility::callUserFunction($hook, $params, $this);
         }
     }
 
@@ -2827,23 +2829,25 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function executeRenderPostTransformHook()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform'])) {
-            $params = [
-                'jsLibs' => &$this->jsLibs,
-                'jsFooterLibs' => &$this->jsFooterLibs,
-                'jsFiles' => &$this->jsFiles,
-                'jsFooterFiles' => &$this->jsFooterFiles,
-                'cssLibs' => &$this->cssLibs,
-                'cssFiles' => &$this->cssFiles,
-                'headerData' => &$this->headerData,
-                'footerData' => &$this->footerData,
-                'jsInline' => &$this->jsInline,
-                'jsFooterInline' => &$this->jsFooterInline,
-                'cssInline' => &$this->cssInline
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform'] as $hook) {
-                GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        $hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform'] ?? false;
+        if (!$hooks) {
+            return;
+        }
+        $params = [
+            'jsLibs' => &$this->jsLibs,
+            'jsFooterLibs' => &$this->jsFooterLibs,
+            'jsFiles' => &$this->jsFiles,
+            'jsFooterFiles' => &$this->jsFooterFiles,
+            'cssLibs' => &$this->cssLibs,
+            'cssFiles' => &$this->cssFiles,
+            'headerData' => &$this->headerData,
+            'footerData' => &$this->footerData,
+            'jsInline' => &$this->jsInline,
+            'jsFooterInline' => &$this->jsFooterInline,
+            'cssInline' => &$this->cssInline
+        ];
+        foreach ($hooks as $hook) {
+            GeneralUtility::callUserFunction($hook, $params, $this);
         }
     }
 
@@ -2862,38 +2866,40 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function executePostRenderHook(&$jsLibs, &$jsFiles, &$jsFooterFiles, &$cssLibs, &$cssFiles, &$jsInline, &$cssInline, &$jsFooterInline, &$jsFooterLibs)
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'])) {
-            $params = [
-                'jsLibs' => &$jsLibs,
-                'jsFiles' => &$jsFiles,
-                'jsFooterFiles' => &$jsFooterFiles,
-                'cssLibs' => &$cssLibs,
-                'cssFiles' => &$cssFiles,
-                'headerData' => &$this->headerData,
-                'footerData' => &$this->footerData,
-                'jsInline' => &$jsInline,
-                'cssInline' => &$cssInline,
-                'xmlPrologAndDocType' => &$this->xmlPrologAndDocType,
-                'htmlTag' => &$this->htmlTag,
-                'headTag' => &$this->headTag,
-                'charSet' => &$this->charSet,
-                'metaCharsetTag' => &$this->metaCharsetTag,
-                'shortcutTag' => &$this->shortcutTag,
-                'inlineComments' => &$this->inlineComments,
-                'baseUrl' => &$this->baseUrl,
-                'baseUrlTag' => &$this->baseUrlTag,
-                'favIcon' => &$this->favIcon,
-                'iconMimeType' => &$this->iconMimeType,
-                'titleTag' => &$this->titleTag,
-                'title' => &$this->title,
-                'metaTags' => &$this->metaTags,
-                'jsFooterInline' => &$jsFooterInline,
-                'jsFooterLibs' => &$jsFooterLibs,
-                'bodyContent' => &$this->bodyContent
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'] as $hook) {
-                GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        $hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'] ?? false;
+        if (!$hooks) {
+            return;
+        }
+        $params = [
+            'jsLibs' => &$jsLibs,
+            'jsFiles' => &$jsFiles,
+            'jsFooterFiles' => &$jsFooterFiles,
+            'cssLibs' => &$cssLibs,
+            'cssFiles' => &$cssFiles,
+            'headerData' => &$this->headerData,
+            'footerData' => &$this->footerData,
+            'jsInline' => &$jsInline,
+            'cssInline' => &$cssInline,
+            'xmlPrologAndDocType' => &$this->xmlPrologAndDocType,
+            'htmlTag' => &$this->htmlTag,
+            'headTag' => &$this->headTag,
+            'charSet' => &$this->charSet,
+            'metaCharsetTag' => &$this->metaCharsetTag,
+            'shortcutTag' => &$this->shortcutTag,
+            'inlineComments' => &$this->inlineComments,
+            'baseUrl' => &$this->baseUrl,
+            'baseUrlTag' => &$this->baseUrlTag,
+            'favIcon' => &$this->favIcon,
+            'iconMimeType' => &$this->iconMimeType,
+            'titleTag' => &$this->titleTag,
+            'title' => &$this->title,
+            'metaTags' => &$this->metaTags,
+            'jsFooterInline' => &$jsFooterInline,
+            'jsFooterLibs' => &$jsFooterLibs,
+            'bodyContent' => &$this->bodyContent
+        ];
+        foreach ($hooks as $hook) {
+            GeneralUtility::callUserFunction($hook, $params, $this);
         }
     }
 
index 1d2f712..21fdec7 100644 (file)
@@ -48,10 +48,10 @@ class SessionManager implements SingletonInterface
     public function getSessionBackend(string $identifier) : SessionBackendInterface
     {
         if (!isset($this->sessionBackends[$identifier])) {
-            if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier]) || !is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier])) {
+            $configuration = $GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier] ?? false;
+            if (!$configuration) {
                 throw new \InvalidArgumentException('Session configuration for identifier ' . $identifier . ' was not found', 1482234750);
             }
-            $configuration = $GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier];
 
             $sessionBackend = $this->createSessionBackendFromConfiguration($identifier, $configuration);
 
index aa19d01..a34735b 100644 (file)
@@ -43,20 +43,16 @@ class FileInfo extends \SplFileInfo implements TypeInterface
             }
         }
 
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Type\File\FileInfo::class]['mimeTypeGuessers'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Type\File\FileInfo::class]['mimeTypeGuesser'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Type\File\FileInfo::class]['mimeTypeGuesser'] as $mimeTypeGuesser) {
-                $hookParameters = [
-                    'mimeType' => &$mimeType
-                ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Type\File\FileInfo::class]['mimeTypeGuesser'] ?? [] as $mimeTypeGuesser) {
+            $hookParameters = [
+                'mimeType' => &$mimeType
+            ];
 
-                \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction(
-                    $mimeTypeGuesser,
-                    $hookParameters,
-                    $this
-                );
-            }
+            \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction(
+                $mimeTypeGuesser,
+                $hookParameters,
+                $this
+            );
         }
 
         return $mimeType;
index 560c483..195d4a7 100644 (file)
@@ -658,17 +658,15 @@ class TemplateService
         }
 
         // Hook into the default TypoScript to add custom typoscript logic
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing'])) {
-            $hookParameters = [
-                'extensionStaticsProcessed' => &$this->extensionStaticsProcessed,
-                'isDefaultTypoScriptAdded'  => &$this->isDefaultTypoScriptAdded,
-                'absoluteRootLine' => &$this->absoluteRootLine,
-                'rootLine'         => &$this->rootLine,
-                'startTemplateUid' => $start_template_uid,
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing'] as $listener) {
-                GeneralUtility::callUserFunction($listener, $hookParameters, $this);
-            }
+        $hookParameters = [
+            'extensionStaticsProcessed' => &$this->extensionStaticsProcessed,
+            'isDefaultTypoScriptAdded'  => &$this->isDefaultTypoScriptAdded,
+            'absoluteRootLine' => &$this->absoluteRootLine,
+            'rootLine'         => &$this->rootLine,
+            'startTemplateUid' => $start_template_uid,
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing'] ?? [] as $listener) {
+            GeneralUtility::callUserFunction($listener, $hookParameters, $this);
         }
 
         // Process extension static files if not done yet, but explicitly requested
@@ -850,16 +848,14 @@ class TemplateService
     public function includeStaticTypoScriptSources($idList, $templateID, $pid, $row)
     {
         // Call function for link rendering:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'])) {
-            $_params = [
-                'idList' => &$idList,
-                'templateId' => &$templateID,
-                'pid' => &$pid,
-                'row' => &$row
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'idList' => &$idList,
+            'templateId' => &$templateID,
+            'pid' => &$pid,
+            'row' => &$row
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         // If "Include before all static templates if root-flag is set" is set:
         if ($row['static_file_mode'] == 3 && strpos($templateID, 'sys_') === 0 && $row['root']) {
@@ -898,16 +894,14 @@ class TemplateService
             $this->addExtensionStatics($idList, $templateID, $pid, $row);
         }
         // Include Static Template Records after all other TypoScript has been included.
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'])) {
-            $_params = [
-                'idList' => &$idList,
-                'templateId' => &$templateID,
-                'pid' => &$pid,
-                'row' => &$row
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'idList' => &$idList,
+            'templateId' => &$templateID,
+            'pid' => &$pid,
+            'row' => &$row
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -1512,15 +1506,13 @@ class TemplateService
         // Compile the normal total url
         $LD['totalURL'] = rtrim($LD['url'] . $LD['type'] . $LD['no_cache'] . $LD['linkVars'] . $this->getTypoScriptFrontendController()->getMethodUrlIdToken, '?') . $LD['sectionIndex'];
         // Call post processing function for link rendering:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['linkData-PostProc'])) {
-            $_params = [
-                'LD' => &$LD,
-                'args' => ['page' => $page, 'oTarget' => $oTarget, 'no_cache' => $no_cache, 'script' => $script, 'overrideArray' => $overrideArray, 'addParams' => $addParams, 'typeOverride' => $typeOverride, 'targetDomain' => $targetDomain],
-                'typeNum' => $typeNum
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['linkData-PostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'LD' => &$LD,
+            'args' => ['page' => $page, 'oTarget' => $oTarget, 'no_cache' => $no_cache, 'script' => $script, 'overrideArray' => $overrideArray, 'addParams' => $addParams, 'typeOverride' => $typeOverride, 'targetDomain' => $targetDomain],
+            'typeNum' => $typeNum
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['linkData-PostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         // Return the LD-array
         return $LD;
index 22e2f1d..9ed4fc2 100644 (file)
@@ -30,21 +30,18 @@ class ClientUtility
     {
         trigger_error('Method getBrowserInfo() is deprecated since v9 and will be removed with v10', E_USER_DEPRECATED);
         // Hook: $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getBrowserInfo']:
-        $getBrowserInfoHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getBrowserInfo'];
-        if (is_array($getBrowserInfoHooks)) {
-            foreach ($getBrowserInfoHooks as $hookFunction) {
-                $returnResult = true;
-                $hookParameters = [
-                    'userAgent' => &$userAgent,
-                    'returnResult' => &$returnResult
-                ];
-                // need reference for third parameter in \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction,
-                // so create a reference to NULL
-                $null = null;
-                $hookResult = GeneralUtility::callUserFunction($hookFunction, $hookParameters, $null);
-                if ($returnResult && is_array($hookResult) && !empty($hookResult)) {
-                    return $hookResult;
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getBrowserInfo'] ?? [] as $hookFunction) {
+            $returnResult = true;
+            $hookParameters = [
+                'userAgent' => &$userAgent,
+                'returnResult' => &$returnResult
+            ];
+            // need reference for third parameter in \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction,
+            // so create a reference to NULL
+            $null = null;
+            $hookResult = GeneralUtility::callUserFunction($hookFunction, $hookParameters, $null);
+            if ($returnResult && is_array($hookResult) && !empty($hookResult)) {
+                return $hookResult;
             }
         }
         $userAgent = trim($userAgent);
index 8253b24..6ca0f97 100644 (file)
@@ -268,14 +268,12 @@ class ExtendedFileUtility extends BasicFileUtility
                                 break;
                         }
                         // Hook for post-processing the action
-                        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'])) {
-                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'] as $className) {
-                                $hookObject = GeneralUtility::makeInstance($className);
-                                if (!$hookObject instanceof ExtendedFileUtilityProcessDataHookInterface) {
-                                    throw new \UnexpectedValueException($className . ' must implement interface ' . ExtendedFileUtilityProcessDataHookInterface::class, 1279719168);
-                                }
-                                $hookObject->processData_postProcessAction($action, $cmdArr, $result[$action], $this);
+                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'] ?? [] as $className) {
+                            $hookObject = GeneralUtility::makeInstance($className);
+                            if (!$hookObject instanceof ExtendedFileUtilityProcessDataHookInterface) {
+                                throw new \UnexpectedValueException($className . ' must implement interface ' . ExtendedFileUtilityProcessDataHookInterface::class, 1279719168);
                             }
+                            $hookObject->processData_postProcessAction($action, $cmdArr, $result[$action], $this);
                         }
                     }
                 }
index d6ee404..ee5a342 100644 (file)
@@ -1752,21 +1752,19 @@ class GeneralUtility
      */
     public static function minifyJavaScript($script, &$error = '')
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'])) {
-            $fakeThis = false;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'] as $hookMethod) {
-                try {
-                    $parameters = ['script' => $script];
-                    $script = static::callUserFunction($hookMethod, $parameters, $fakeThis);
-                } catch (\Exception $e) {
-                    $errorMessage = 'Error minifying java script: ' . $e->getMessage();
-                    $error .= $errorMessage;
-                    static::getLogger()->warning($errorMessage, [
-                        'JavaScript' => $script,
-                        'hook' => $hookMethod,
-                        'exception' => $e,
-                    ]);
-                }
+        $fakeThis = false;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'] ?? [] as $hookMethod) {
+            try {
+                $parameters = ['script' => $script];
+                $script = static::callUserFunction($hookMethod, $parameters, $fakeThis);
+            } catch (\Exception $e) {
+                $errorMessage = 'Error minifying java script: ' . $e->getMessage();
+                $error .= $errorMessage;
+                static::getLogger()->warning($errorMessage, [
+                    'JavaScript' => $script,
+                    'hook' => $hookMethod,
+                    'exception' => $e,
+                ]);
             }
         }
         return $script;
@@ -3543,14 +3541,7 @@ class GeneralUtility
      */
     protected static function classHasImplementation($className)
     {
-        // If we are early in the bootstrap, the configuration might not yet be present
-        if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'])) {
-            return false;
-        }
-
-        return isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$className])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$className])
-                && !empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$className]['className']);
+        return !empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$className]['className']);
     }
 
     /**
@@ -3777,12 +3768,10 @@ class GeneralUtility
     public static function initSysLog()
     {
         // Init custom logging
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
-            $params = ['initLog' => true];
-            $fakeThis = false;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] as $hookMethod) {
-                self::callUserFunction($hookMethod, $params, $fakeThis);
-            }
+        $params = ['initLog' => true];
+        $fakeThis = false;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] ?? [] as $hookMethod) {
+            self::callUserFunction($hookMethod, $params, $fakeThis);
         }
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = MathUtility::forceIntegerInRange($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'], 0, 4);
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit'] = true;
@@ -3813,8 +3802,8 @@ class GeneralUtility
         if (!$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit']) {
             self::initSysLog();
         }
-        // Do custom logging
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
+        // Do custom logging; avoid calling debug_backtrace if there are no custom loggers.
+        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
             $params = ['msg' => $msg, 'extKey' => $extKey, 'backTrace' => debug_backtrace(), 'severity' => $severity];
             $fakeThis = false;
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] as $hookMethod) {
index 2d3be09..08d8264 100644 (file)
@@ -54,8 +54,7 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface
     {
         if ($this->availableCommands === null) {
             $this->availableCommands = [];
-            $commandControllerClassNames = is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers']) ? $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'] : [];
-            foreach ($commandControllerClassNames as $className) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'] ?? [] as $className) {
                 if (!class_exists($className)) {
                     continue;
                 }
index ba9fe83..888ea3c 100644 (file)
@@ -100,15 +100,13 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface
                 return $frameworkConfiguration['pluginName'];
             }
         }
-        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'])) {
+        $plugins = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'] ?? false;
+        if (!$plugins) {
             return null;
         }
         $pluginNames = [];
-        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'] as $pluginName => $pluginConfiguration) {
-            if (!is_array($pluginConfiguration['controllers'])) {
-                continue;
-            }
-            foreach ($pluginConfiguration['controllers'] as $pluginControllerName => $pluginControllerActions) {
+        foreach ($plugins as $pluginName => $pluginConfiguration) {
+            foreach ($pluginConfiguration['controllers'] ?? [] as $pluginControllerName => $pluginControllerActions) {
                 if (strtolower($pluginControllerName) !== strtolower($controllerName)) {
                     continue;
                 }
@@ -206,11 +204,8 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function getDefaultControllerNameByPlugin($extensionName, $pluginName)
     {
-        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'])) {
-            return null;
-        }
-        $controllers = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'];
-        return key($controllers);
+        $controllers = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'] ?? false;
+        return $controllers ? key($controllers) : null;
     }
 
     /**
@@ -223,11 +218,8 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function getDefaultActionNameByPluginAndController($extensionName, $pluginName, $controllerName)
     {
-        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerName]['actions'])) {
-            return null;
-        }
-        $actions = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerName]['actions'];
-        return current($actions);
+        $actions = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerName]['actions'] ?? false;
+        return $actions ? current($actions) : null;
     }
 
     /**
@@ -239,12 +231,7 @@ class ExtensionService implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function getTargetPageTypeByFormat($extensionName, $format)
     {
-        $targetPageType = 0;
         $settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, $extensionName);
-        $formatToPageTypeMapping = isset($settings['view']['formatToPageTypeMapping']) ? $settings['view']['formatToPageTypeMapping'] : [];
-        if (is_array($formatToPageTypeMapping) && array_key_exists($format, $formatToPageTypeMapping)) {
-            $targetPageType = (int)$formatToPageTypeMapping[$format];
-        }
-        return $targetPageType;
+        return $settings['view']['formatToPageTypeMapping'][$format] ?? 0;
     }
 }
index d1cdcbb..2a905cd 100644 (file)
@@ -92,7 +92,7 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface
         ];
         // The in_array() comparision needs to be strict to avoid potential issues
         // with complex objects being registered as slot.
-        if (!is_array($this->slots[$signalClassName][$signalName]) || !in_array($slot, $this->slots[$signalClassName][$signalName], true)) {
+        if (!is_array($this->slots[$signalClassName][$signalName] ?? false) || !in_array($slot, $this->slots[$signalClassName][$signalName], true)) {
             $this->slots[$signalClassName][$signalName][] = $slot;
         }
     }
index fa0f78c..b989f03 100644 (file)
@@ -181,34 +181,24 @@ class FrontendLoginController extends AbstractPlugin implements LoggerAwareInter
                 $content .= $this->cObj->stdWrap($this->pi_getLL('cookie_warning'), $this->conf['cookieWarning_stdWrap.']);
             } else {
                 // Add hook for extra processing before redirect
-                if (
-                    isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect']) &&
-                    is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'])
-                ) {
-                    $_params = [
-                        'loginType' => $this->logintype,
-                        'redirectUrl' => &$this->redirectUrl
-                    ];
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'] as $_funcRef) {
-                        if ($_funcRef) {
-                            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                        }
+                $_params = [
+                    'loginType' => $this->logintype,
+                    'redirectUrl' => &$this->redirectUrl
+                ];
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'] ?? [] as $_funcRef) {
+                    if ($_funcRef) {
+                        GeneralUtility::callUserFunction($_funcRef, $_params, $this);
                     }
                 }
                 \TYPO3\CMS\Core\Utility\HttpUtility::redirect($this->redirectUrl);
             }
         }
         // Adds hook for processing of extra item markers / special
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['postProcContent'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['postProcContent'])
-        ) {
-            $_params = [
-                'content' => $content
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['postProcContent'] as $_funcRef) {
-                $content = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'content' => $content
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['postProcContent'] ?? [] as $_funcRef) {
+            $content = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return $this->conf['wrapContentInBaseClass'] ? $this->pi_wrapInBaseClass($content) : $content;
     }
@@ -482,18 +472,13 @@ class FrontendLoginController extends AbstractPlugin implements LoggerAwareInter
         }
         $msg = sprintf($this->pi_getLL('ll_forgot_validate_reset_password'), $user['username'], $link, $validEndString);
         // Add hook for extra processing of mail message
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'])
-        ) {
-            $params = [
-                'message' => &$msg,
-                'user' => &$user
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'] as $reference) {
-                if ($reference) {
-                    GeneralUtility::callUserFunction($reference, $params, $this);
-                }
+        $params = [
+            'message' => &$msg,
+            'user' => &$user
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'] ?? [] as $reference) {
+            if ($reference) {
+                GeneralUtility::callUserFunction($reference, $params, $this);
             }
         }
         if ($user['email']) {
@@ -552,12 +537,10 @@ class FrontendLoginController extends AbstractPlugin implements LoggerAwareInter
                 $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
                 $subpartArray['###LOGIN_FORM###'] = '';
                 // Hook for general actions after after login has been confirmed (by Thomas Danzl <thomas@danzl.org>)
-                if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed']) {
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'] ?? [] as $_funcRef) {
                     $_params = [];
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'] as $_funcRef) {
-                        if ($_funcRef) {
-                            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                        }
+                    if ($_funcRef) {
+                        GeneralUtility::callUserFunction($_funcRef, $_params, $this);
                     }
                 }
                 // show logout form directly
@@ -567,15 +550,10 @@ class FrontendLoginController extends AbstractPlugin implements LoggerAwareInter
                 }
             } else {
                 // Hook for general actions on login error
-                if (
-                    isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'])
-                    && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'])
-                ) {
-                    $params = [];
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'] as $funcRef) {
-                        if ($funcRef) {
-                            GeneralUtility::callUserFunction($funcRef, $params, $this);
-                        }
+                $params = [];
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_error'] ?? [] as $funcRef) {
+                    if ($funcRef) {
+                        GeneralUtility::callUserFunction($funcRef, $params, $this);
                     }
                 }
                 // login error
@@ -611,13 +589,11 @@ class FrontendLoginController extends AbstractPlugin implements LoggerAwareInter
                 }
             }
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'])) {
-            $_params = [];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'] as $funcRef) {
-                list($onSub, $hid) = GeneralUtility::callUserFunction($funcRef, $_params, $this);
-                $onSubmitAr[] = $onSub;
-                $extraHiddenAr[] = $hid;
-            }
+        $_params = [];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'] ?? [] as $funcRef) {
+            list($onSub, $hid) = GeneralUtility::callUserFunction($funcRef, $_params, $this);
+            $onSubmitAr[] = $onSub;
+            $extraHiddenAr[] = $hid;
         }
         if (!empty($onSubmitAr)) {
             $onSubmit = implode('; ', $onSubmitAr) . '; return true;';
@@ -814,12 +790,10 @@ class FrontendLoginController extends AbstractPlugin implements LoggerAwareInter
                 } elseif ($this->logintype === 'logout') {
                     // after logout
                     // Hook for general actions after after logout has been confirmed
-                    if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed']) {
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed'] ?? [] as $_funcRef) {
                         $_params = [];
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed'] as $_funcRef) {
-                            if ($_funcRef) {
-                                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                            }
+                        if ($_funcRef) {
+                            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
                         }
                     }
                     switch ($redirMethod) {
index 5600d27..680e081 100644 (file)
@@ -1430,20 +1430,18 @@ class FileList
         }
 
         // Hook for manipulating edit icons.
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] ?? false)) {
-            $cells['__fileOrFolderObject'] = $fileOrFolderObject;
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof FileListEditIconHookInterface) {
-                    throw new \UnexpectedValueException(
-                        $className . ' must implement interface ' . FileListEditIconHookInterface::class,
-                        1235225797
-                    );
-                }
-                $hookObject->manipulateEditIcons($cells, $this);
+        $cells['__fileOrFolderObject'] = $fileOrFolderObject;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof FileListEditIconHookInterface) {
+                throw new \UnexpectedValueException(
+                    $className . ' must implement interface ' . FileListEditIconHookInterface::class,
+                    1235225797
+                );
             }
-            unset($cells['__fileOrFolderObject']);
+            $hookObject->manipulateEditIcons($cells, $this);
         }
+        unset($cells['__fileOrFolderObject']);
         // Compile items into a DIV-element:
         return '<div class="btn-group">' . implode('', $cells) . '</div>';
     }
index 5351eb4..f9c2f60 100644 (file)
@@ -142,18 +142,13 @@ class FormEditorController extends AbstractBackendController
         $formDefinition = ArrayUtility::stripTagsFromValuesRecursive($formDefinition);
         $formDefinition = $this->convertJsonArrayToAssociativeArray($formDefinition);
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormSave'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormSave'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormSave'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'beforeFormSave')) {
-                    $formDefinition = $hookObj->beforeFormSave(
-                        $formPersistenceIdentifier,
-                        $formDefinition
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormSave'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'beforeFormSave')) {
+                $formDefinition = $hookObj->beforeFormSave(
+                    $formPersistenceIdentifier,
+                    $formDefinition
+                );
             }
         }
 
index eeee92b..0eb9ef3 100644 (file)
@@ -106,18 +106,13 @@ class FormManagerController extends AbstractBackendController
 
         $formPersistenceIdentifier = $this->formPersistenceManager->getUniquePersistenceIdentifier($form['identifier'], $savePath);
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormCreate'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormCreate'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormCreate'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'beforeFormCreate')) {
-                    $form = $hookObj->beforeFormCreate(
-                        $formPersistenceIdentifier,
-                        $form
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormCreate'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'beforeFormCreate')) {
+                $form = $hookObj->beforeFormCreate(
+                    $formPersistenceIdentifier,
+                    $form
+                );
             }
         }
 
@@ -143,18 +138,13 @@ class FormManagerController extends AbstractBackendController
 
         $formPersistenceIdentifier = $this->formPersistenceManager->getUniquePersistenceIdentifier($formToDuplicate['identifier'], $savePath);
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDuplicate'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDuplicate'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDuplicate'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'beforeFormDuplicate')) {
-                    $formToDuplicate = $hookObj->beforeFormDuplicate(
-                        $formPersistenceIdentifier,
-                        $formToDuplicate
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDuplicate'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'beforeFormDuplicate')) {
+                $formToDuplicate = $hookObj->beforeFormDuplicate(
+                    $formPersistenceIdentifier,
+                    $formToDuplicate
+                );
             }
         }
 
@@ -190,17 +180,12 @@ class FormManagerController extends AbstractBackendController
     public function deleteAction(string $formPersistenceIdentifier)
     {
         if (empty($this->getReferences($formPersistenceIdentifier))) {
-            if (
-                isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDelete'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDelete'])
-            ) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDelete'] as $className) {
-                    $hookObj = GeneralUtility::makeInstance($className);
-                    if (method_exists($hookObj, 'beforeFormDelete')) {
-                        $hookObj->beforeFormDelete(
-                            $formPersistenceIdentifier
-                        );
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDelete'] ?? [] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
+                if (method_exists($hookObj, 'beforeFormDelete')) {
+                    $hookObj->beforeFormDelete(
+                        $formPersistenceIdentifier
+                    );
                 }
             }
 
index 1a2169a..72b3549 100644 (file)
@@ -61,17 +61,12 @@ abstract class AbstractFormFactory implements FormFactoryInterface
     protected function triggerFormBuildingFinished(FormDefinition $form)
     {
         foreach ($form->getRenderablesRecursively() as $renderable) {
-            if (
-                isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'])
-            ) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'] as $className) {
-                    $hookObj = GeneralUtility::makeInstance($className);
-                    if (method_exists($hookObj, 'afterBuildingFinished')) {
-                        $hookObj->afterBuildingFinished(
-                            $renderable
-                        );
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'] ?? [] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
+                if (method_exists($hookObj, 'afterBuildingFinished')) {
+                    $hookObj->afterBuildingFinished(
+                        $renderable
+                    );
                 }
             }
         }
index 79fee0b..240e9f2 100644 (file)
@@ -73,17 +73,12 @@ abstract class AbstractFormElement extends AbstractRenderable implements FormEle
      */
     public function initializeFormElement()
     {
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'initializeFormElement')) {
-                    $hookObj->initializeFormElement(
-                        $this
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'initializeFormElement')) {
+                $hookObj->initializeFormElement(
+                    $this
+                );
             }
         }
     }
index b36a8ae..b249767 100644 (file)
@@ -47,17 +47,12 @@ class Section extends AbstractSection implements FormElementInterface
      */
     public function initializeFormElement()
     {
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'initializeFormElement')) {
-                    $hookObj->initializeFormElement(
-                        $this
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'initializeFormElement')) {
+                $hookObj->initializeFormElement(
+                    $this
+                );
             }
         }
     }
index d498cee..fa898c8 100644 (file)
@@ -51,17 +51,12 @@ class UnknownFormElement extends AbstractRenderable implements FormElementInterf
      */
     public function initializeFormElement()
     {
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'initializeFormElement')) {
-                    $hookObj->initializeFormElement(
-                        $this
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'initializeFormElement')) {
+                $hookObj->initializeFormElement(
+                    $this
+                );
             }
         }
     }
index b366748..2f1e603 100644 (file)
@@ -329,17 +329,12 @@ abstract class AbstractRenderable implements RenderableInterface
      */
     public function onRemoveFromParentRenderable()
     {
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRemoveFromParentRenderable'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRemoveFromParentRenderable'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRemoveFromParentRenderable'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'beforeRemoveFromParentRenderable')) {
-                    $hookObj->beforeRemoveFromParentRenderable(
-                        $this
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRemoveFromParentRenderable'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'beforeRemoveFromParentRenderable')) {
+                $hookObj->beforeRemoveFromParentRenderable(
+                    $this
+                );
             }
         }
 
index b543156..85e8f4d 100644 (file)
@@ -174,18 +174,13 @@ class FluidFormRenderer extends AbstractElementRenderer implements RendererInter
         // from the renderable
         $view->getTemplatePaths()->fillFromConfigurationArray($renderingOptions);
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'beforeRendering')) {
-                    $hookObj->beforeRendering(
-                        $this->formRuntime,
-                        $this->formRuntime->getFormDefinition()
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'beforeRendering')) {
+                $hookObj->beforeRendering(
+                    $this->formRuntime,
+                    $this->formRuntime->getFormDefinition()
+                );
             }
         }
 
index a7ea342..7616c71 100644 (file)
@@ -204,20 +204,15 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
     {
         if (!$this->formState->isFormSubmitted()) {
             $this->currentPage = $this->formDefinition->getPageByIndex(0);
-            if (
-                isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'])
-            ) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'] as $className) {
-                    $hookObj = GeneralUtility::makeInstance($className);
-                    if (method_exists($hookObj, 'afterInitializeCurrentPage')) {
-                        $this->currentPage = $hookObj->afterInitializeCurrentPage(
-                            $this,
-                            $this->currentPage,
-                            null,
-                            $this->request->getArguments()
-                        );
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'] ?? [] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
+                if (method_exists($hookObj, 'afterInitializeCurrentPage')) {
+                    $this->currentPage = $hookObj->afterInitializeCurrentPage(
+                        $this,
+                        $this->currentPage,
+                        null,
+                        $this->request->getArguments()
+                    );
                 }
             }
             return;
@@ -239,20 +234,15 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
             $this->currentPage = $this->formDefinition->getPageByIndex($currentPageIndex);
         }
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'afterInitializeCurrentPage')) {
-                    $this->currentPage = $hookObj->afterInitializeCurrentPage(
-                        $this,
-                        $this->currentPage,
-                        $this->lastDisplayedPage,
-                        $this->request->getArguments()
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'afterInitializeCurrentPage')) {
+                $this->currentPage = $hookObj->afterInitializeCurrentPage(
+                    $this,
+                    $this->currentPage,
+                    $this->lastDisplayedPage,
+                    $this->request->getArguments()
+                );
             }
         }
     }
@@ -435,20 +425,16 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
         };
 
         $value = null;
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'afterSubmit')) {
-                    $value = $hookObj->afterSubmit(
-                        $this,
-                        $page,
-                        $value,
-                        $requestArguments
-                    );
-                }
+
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'afterSubmit')) {
+                $value = $hookObj->afterSubmit(
+                    $this,
+                    $page,
+                    $value,
+                    $requestArguments
+                );
             }
         }
 
@@ -459,20 +445,15 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess
                 $value = null;
             }
 
-            if (
-                isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'])
-            ) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'] as $className) {
-                    $hookObj = GeneralUtility::makeInstance($className);
-                    if (method_exists($hookObj, 'afterSubmit')) {
-                        $value = $hookObj->afterSubmit(
-                            $this,
-                            $element,
-                            $value,
-                            $requestArguments
-                        );
-                    }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'] ?? [] as $className) {
+                $hookObj = GeneralUtility::makeInstance($className);
+                if (method_exists($hookObj, 'afterSubmit')) {
+                    $value = $hookObj->afterSubmit(
+                        $this,
+                        $element,
+                        $value,
+                        $requestArguments
+                    );
                 }
             }
 
index b08d56c..b071d7f 100644 (file)
@@ -68,18 +68,13 @@ class RenderRenderableViewHelper extends AbstractViewHelper
             ->getViewHelperVariableContainer()
             ->get(self::class, 'formRuntime');
 
-        if (
-            isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObj, 'beforeRendering')) {
-                    $hookObj->beforeRendering(
-                        $formRuntime,
-                        $arguments['renderable']
-                    );
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeRendering'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObj, 'beforeRendering')) {
+                $hookObj->beforeRendering(
+                    $formRuntime,
+                    $arguments['renderable']
+                );
             }
         }
 
index ca9c1c6..39ed6d8 100644 (file)
@@ -81,11 +81,9 @@ class ContentContentObject extends AbstractContentObject
 
                 foreach ($records as $row) {
                     // Call hook for possible manipulation of database row for cObj->data
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content_content.php']['modifyDBRow'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content_content.php']['modifyDBRow'] as $className) {
-                            $_procObj = GeneralUtility::makeInstance($className);
-                            $_procObj->modifyDBRow($row, $conf['table']);
-                        }
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content_content.php']['modifyDBRow'] ?? [] as $className) {
+                        $_procObj = GeneralUtility::makeInstance($className);
+                        $_procObj->modifyDBRow($row, $conf['table']);
                     }
                     if (!$frontendController->recordRegister[$conf['table'] . ':' . $row['uid']]) {
                         $this->cObj->currentRecordNumber++;
index 500c738..b4d7427 100644 (file)
@@ -550,29 +550,23 @@ class ContentObjectRenderer
         $this->table = $table;
         $this->currentRecord = $table !== '' ? $table . ':' . $this->data['uid'] : '';
         $this->parameters = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'] as $classArr) {
-                $this->cObjHookObjectsRegistry[$classArr[0]] = $classArr[1];
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'] ?? [] as $classArr) {
+            $this->cObjHookObjectsRegistry[$classArr[0]] = $classArr[1];
         }
         $this->stdWrapHookObjects = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof ContentObjectStdWrapHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . ContentObjectStdWrapHookInterface::class, 1195043965);
-                }
-                $this->stdWrapHookObjects[] = $hookObject;
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof ContentObjectStdWrapHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . ContentObjectStdWrapHookInterface::class, 1195043965);
             }
+            $this->stdWrapHookObjects[] = $hookObject;
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'] as $className) {
-                $postInitializationProcessor = GeneralUtility::makeInstance($className);
-                if (!$postInitializationProcessor instanceof ContentObjectPostInitHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . ContentObjectPostInitHookInterface::class, 1274563549);
-                }
-                $postInitializationProcessor->postProcessContentObjectInitialization($this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'] ?? [] as $className) {
+            $postInitializationProcessor = GeneralUtility::makeInstance($className);
+            if (!$postInitializationProcessor instanceof ContentObjectPostInitHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . ContentObjectPostInitHookInterface::class, 1274563549);
             }
+            $postInitializationProcessor->postProcessContentObjectInitialization($this);
         }
     }
 
@@ -596,14 +590,12 @@ class ContentObjectRenderer
     {
         if (!isset($this->getImgResourceHookObjects)) {
             $this->getImgResourceHookObjects = [];
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof ContentObjectGetImageResourceHookInterface) {
-                        throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetImageResourceHookInterface::class, 1218636383);
-                    }
-                    $this->getImgResourceHookObjects[] = $hookObject;
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof ContentObjectGetImageResourceHookInterface) {
+                    throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetImageResourceHookInterface::class, 1218636383);
                 }
+                $this->getImgResourceHookObjects[] = $hookObject;
             }
         }
         return $this->getImgResourceHookObjects;
@@ -731,8 +723,8 @@ class ContentObjectRenderer
                         $content .= $this->render($contentObject, $conf);
                     } else {
                         // Call hook functions for extra processing
-                        if ($name && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'])) {
-                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] as $className) {
+                        if ($name) {
+                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] ?? [] as $className) {
                                 $hookObject = GeneralUtility::makeInstance($className);
                                 if (!$hookObject instanceof ContentObjectGetSingleHookInterface) {
                                     throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetSingleHookInterface::class, 1195043731);
@@ -1219,17 +1211,15 @@ class ContentObjectRenderer
 
                     $oneSourceCollection = $this->templateService->substituteMarkerArray($sourceLayout, $sourceConfiguration, '###|###', true, true);
 
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'] as $className) {
-                            $hookObject = GeneralUtility::makeInstance($className);
-                            if (!$hookObject instanceof ContentObjectOneSourceCollectionHookInterface) {
-                                throw new \UnexpectedValueException(
-                                    '$hookObject must implement interface ' . ContentObjectOneSourceCollectionHookInterface::class,
-                                    1380007853
-                                );
-                            }
-                            $oneSourceCollection = $hookObject->getOneSourceCollection((array)$sourceRenderConfiguration, (array)$sourceConfiguration, $oneSourceCollection, $this);
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'] ?? [] as $className) {
+                        $hookObject = GeneralUtility::makeInstance($className);
+                        if (!$hookObject instanceof ContentObjectOneSourceCollectionHookInterface) {
+                            throw new \UnexpectedValueException(
+                                '$hookObject must implement interface ' . ContentObjectOneSourceCollectionHookInterface::class,
+                                1380007853
+                            );
                         }
+                        $oneSourceCollection = $hookObject->getOneSourceCollection((array)$sourceRenderConfiguration, (array)$sourceConfiguration, $oneSourceCollection, $this);
                     }
 
                     $sourceCollection .= $oneSourceCollection;
@@ -1452,15 +1442,13 @@ class ContentObjectRenderer
             $aTagParams = ' ' . trim($this->getTypoScriptFrontendController()->ATagParams . $aTagParams);
         }
         // Extend params
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParamsPostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParamsPostProc'])) {
-            $_params = [
-                'conf' => &$conf,
-                'aTagParams' => &$aTagParams
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParamsPostProc'] as $className) {
-                $processor =& GeneralUtility::makeInstance($className);
-                $aTagParams = $processor->process($_params, $this);
-            }
+        $_params = [
+            'conf' => &$conf,
+            'aTagParams' => &$aTagParams
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParamsPostProc'] ?? [] as $className) {
+            $processor =& GeneralUtility::makeInstance($className);
+            $aTagParams = $processor->process($_params, $this);
         }
 
         $aTagParams = trim($aTagParams);
@@ -2940,16 +2928,14 @@ class ContentObjectRenderer
         $cacheFrontend = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
         $tags = $this->calculateCacheTags($conf['cache.']);
         $lifetime = $this->calculateCacheLifetime($conf['cache.']);
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] as $_funcRef) {
-                $params = [
-                    'key' => $key,
-                    'content' => $content,
-                    'lifetime' => $lifetime,
-                    'tags' => $tags
-                ];
-                GeneralUtility::callUserFunction($_funcRef, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] ?? [] as $_funcRef) {
+            $params = [
+                'key' => $key,
+                'content' => $content,
+                'lifetime' => $lifetime,
+                'tags' => $tags
+            ];
+            GeneralUtility::callUserFunction($_funcRef, $params, $this);
         }
         $cacheFrontend->set($key, $content, $tags, $lifetime);
         return $content;
@@ -4998,14 +4984,13 @@ class ContentObjectRenderer
                         break;
                 }
             }
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof ContentObjectGetDataHookInterface) {
-                        throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetDataHookInterface::class, 1195044480);
-                    }
-                    $retVal = $hookObject->getDataExtension($string, $fieldArray, $secVal, $retVal, $this);
+
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof ContentObjectGetDataHookInterface) {
+                    throw new \UnexpectedValueException('$hookObject must implement interface ' . ContentObjectGetDataHookInterface::class, 1195044480);
                 }
+                $retVal = $hookObject->getDataExtension($string, $fieldArray, $secVal, $retVal, $this);
             }
         }
         return $retVal;
@@ -5414,18 +5399,16 @@ class ContentObjectRenderer
         }
 
         // Hook: Call post processing function for link rendering:
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc'])) {
-            $_params = [
-                'conf' => &$conf,
-                'linktxt' => &$linkText,
-                'finalTag' => &$finalAnchorTag,
-                'finalTagParts' => &$finalTagParts,
-                'linkDetails' => &$linkDetails,
-                'tagAttributes' => &$tagAttributes
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'conf' => &$conf,
+            'linktxt' => &$linkText,
+            'finalTag' => &$finalAnchorTag,
+            'finalTagParts' => &$finalTagParts,
+            'linkDetails' => &$linkDetails,
+            'tagAttributes' => &$tagAttributes
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
 
         // If flag "returnLastTypoLinkUrl" set, then just return the latest URL made:
@@ -5571,14 +5554,11 @@ class ContentObjectRenderer
      */
     protected function processUrl($context, $url, $typolinkConfiguration = [])
     {
-        if (
-            empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'])
-        ) {
+        $urlProcessors = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'] ?? [];
+        if (empty($urlProcessors)) {
             return $url;
         }
 
-        $urlProcessors = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'];
         foreach ($urlProcessors as $identifier => $configuration) {
             if (empty($configuration) || !is_array($configuration)) {
                 throw new \RuntimeException('Missing configuration for URI processor "' . $identifier . '".', 1442050529);
index ad6456b..36a114b 100644 (file)
@@ -1243,14 +1243,12 @@ abstract class AbstractMenuContentObject
     public function filterMenuPages(&$data, $banUidArray, $spacer)
     {
         $includePage = true;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof AbstractMenuFilterPagesHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . AbstractMenuFilterPagesHookInterface::class, 1269877402);
-                }
-                $includePage = $includePage && $hookObject->processFilter($data, $banUidArray, $spacer, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof AbstractMenuFilterPagesHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . AbstractMenuFilterPagesHookInterface::class, 1269877402);
             }
+            $includePage = $includePage && $hookObject->processFilter($data, $banUidArray, $spacer, $this);
         }
         if (!$includePage) {
             return false;
index 5711cce..732992a 100644 (file)
@@ -808,11 +808,8 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         $this->uniqueString = md5(microtime());
         $this->initPageRenderer();
         // Call post processing function for constructor:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         $this->cacheHash = GeneralUtility::makeInstance(CacheHashCalculator::class);
         $this->initCaches();
@@ -862,11 +859,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             }
         }
         // Call post processing function for DB connection:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -912,11 +907,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         $this->fe_user->unpack_uc();
 
         // Call hook for possible manipulation of frontend user object
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         // For every 60 seconds the is_online timestamp is updated.
         if (is_array($this->fe_user->user) && $this->fe_user->user['uid'] && $this->fe_user->user['is_online'] < $GLOBALS['EXEC_TIME'] - 60) {
@@ -994,11 +987,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     {
         $this->siteScript = GeneralUtility::getIndpEnv('TYPO3_SITE_SCRIPT');
         // Call post processing function for custom URL methods.
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -1034,11 +1025,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     public function initializeBackendUser()
     {
         // PRE BE_USER HOOK
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'] as $_funcRef) {
-                $_params = [];
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'] ?? [] as $_funcRef) {
+            $_params = [];
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         $backendUserObject = null;
         // If the backend cookie is set,
@@ -1067,13 +1056,11 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'] = microtime(true);
         }
         // POST BE_USER HOOK
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser'])) {
-            $_params = [
-                'BE_USER' => &$backendUserObject
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'BE_USER' => &$backendUserObject
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return $backendUserObject;
     }
@@ -1087,11 +1074,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     public function determineId()
     {
         // Call pre processing function for id determination
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PreProcessing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PreProcessing'] as $functionReference) {
-                $parameters = ['parentObject' => $this];
-                GeneralUtility::callUserFunction($functionReference, $parameters, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PreProcessing'] ?? [] as $functionReference) {
+            $parameters = ['parentObject' => $this];
+            GeneralUtility::callUserFunction($functionReference, $parameters, $this);
         }
         // If there is a Backend login we are going to check for any preview settings:
         $this->getTimeTracker()->push('beUserLogin', '');
@@ -1193,11 +1178,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         // Make sure it's an integer
         $this->type = (int)$this->type;
         // Call post processing function for id determination:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -1376,11 +1359,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         if ($this->register['SYS_LASTCHANGED'] < (int)$this->page['SYS_LASTCHANGED']) {
             $this->register['SYS_LASTCHANGED'] = (int)$this->page['SYS_LASTCHANGED'];
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['fetchPageId-PostProcessing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['fetchPageId-PostProcessing'] as $functionReference) {
-                $parameters = ['parentObject' => $this];
-                GeneralUtility::callUserFunction($functionReference, $parameters, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['fetchPageId-PostProcessing'] ?? [] as $functionReference) {
+            $parameters = ['parentObject' => $this];
+            GeneralUtility::callUserFunction($functionReference, $parameters, $this);
         }
     }
 
@@ -1678,14 +1659,12 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     public function checkEnableFields($row, $bypassGroupCheck = false)
     {
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_checkEnableFields']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_checkEnableFields'])) {
-            $_params = ['pObj' => $this, 'row' => &$row, 'bypassGroupCheck' => &$bypassGroupCheck];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_checkEnableFields'] as $_funcRef) {
-                // Call hooks: If one returns FALSE, method execution is aborted with result "This record is not available"
-                $return = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                if ($return === false) {
-                    return false;
-                }
+        $_params = ['pObj' => $this, 'row' => &$row, 'bypassGroupCheck' => &$bypassGroupCheck];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_checkEnableFields'] ?? [] as $_funcRef) {
+            // Call hooks: If one returns FALSE, method execution is aborted with result "This record is not available"
+            $return = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
+            if ($return === false) {
+                return false;
             }
         }
         if ((!$row['hidden'] || $this->showHiddenPage) && $row['starttime'] <= $GLOBALS['SIM_ACCESS_TIME'] && ($row['endtime'] == 0 || $row['endtime'] > $GLOBALS['SIM_ACCESS_TIME']) && ($bypassGroupCheck || $this->checkPageGroupAccess($row))) {
@@ -2272,11 +2251,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
                     // we have data from cache
 
                     // Call hook when a page is retrieved from cache:
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'])) {
-                        $_params = ['pObj' => &$this, 'cache_pages_row' => &$row];
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'] as $_funcRef) {
-                            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                        }
+                    $_params = ['pObj' => &$this, 'cache_pages_row' => &$row];
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'] ?? [] as $_funcRef) {
+                        GeneralUtility::callUserFunction($_funcRef, $_params, $this);
                     }
                     // Fetches the lowlevel config stored with the cached data
                     $this->config = $row['cache_data'];
@@ -2344,11 +2321,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             }
         }
         // Call hook for possible by-pass of requiring of page cache (for recaching purpose)
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'])) {
-            $_params = ['pObj' => &$this, 'disableAcquireCacheData' => &$disableAcquireCacheData];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this, 'disableAcquireCacheData' => &$disableAcquireCacheData];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return $disableAcquireCacheData;
     }
@@ -2406,14 +2381,12 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $hashParameters['all'] = $this->all;
         }
         // Call hook to influence the hash calculation
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'])) {
-            $_params = [
-                'hashParameters' => &$hashParameters,
-                'createLockHashBase' => $createLockHashBase
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [
+            'hashParameters' => &$hashParameters,
+            'createLockHashBase' => $createLockHashBase
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return serialize($hashParameters);
     }
@@ -2510,11 +2483,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             GeneralUtility::_GETset($modifiedGetVars);
         }
         // Hook for postProcessing the configuration array
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'])) {
-            $params = ['config' => &$this->config['config']];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'] as $funcRef) {
-                GeneralUtility::callUserFunction($funcRef, $params, $this);
-            }
+        $params = ['config' => &$this->config['config']];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'] ?? [] as $funcRef) {
+            GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
 
@@ -2532,11 +2503,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     public function settingLanguage()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_preProcess'])) {
-            $_params = [];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_preProcess'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_preProcess'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
 
         // Initialize charset settings etc.
@@ -2641,11 +2610,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             }
         }
 
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess'])) {
-            $_params = [];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = [];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -2717,11 +2684,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     public function handleDataSubmission()
     {
         // Hook for processing data submission to extensions
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] as $className) {
-                $_procObj = GeneralUtility::makeInstance($className);
-                $_procObj->checkDataSubmission($this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] ?? [] as $className) {
+            $_procObj = GeneralUtility::makeInstance($className);
+            $_procObj->checkDataSubmission($this);
         }
     }
 
@@ -2732,14 +2697,11 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     public function initializeRedirectUrlHandlers()
     {
-        if (
-            empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlHandlers'])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlHandlers'])
-        ) {
+        $urlHandlers = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlHandlers'] ?? false;
+        if (!$urlHandlers) {
             return;
         }
 
-        $urlHandlers = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlHandlers'];
         foreach ($urlHandlers as $identifier => $configuration) {
             if (empty($configuration) || !is_array($configuration)) {
                 throw new \RuntimeException('Missing configuration for URL handler "' . $identifier . '".', 1442052263);
@@ -2995,22 +2957,18 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         // Hook for deciding whether page cache should be written to the cache backend or not
         // NOTE: as hooks are called in a loop, the last hook will have the final word (however each
         // hook receives the current status of the $usePageCache flag)
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'] as $className) {
-                $_procObj = GeneralUtility::makeInstance($className);
-                $usePageCache = $_procObj->usePageCache($this, $usePageCache);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'] ?? [] as $className) {
+            $_procObj = GeneralUtility::makeInstance($className);
+            $usePageCache = $_procObj->usePageCache($this, $usePageCache);
         }
         // Write the page to cache, if necessary
         if ($usePageCache) {
             $this->setPageCacheContent($this->content, $this->config, $timeOutTime);
         }
         // Hook for cache post processing (eg. writing static files!)
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'] as $className) {
-                $_procObj = GeneralUtility::makeInstance($className);
-                $_procObj->insertPageIncache($this, $timeOutTime);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'] ?? [] as $className) {
+            $_procObj = GeneralUtility::makeInstance($className);
+            $_procObj->insertPageIncache($this, $timeOutTime);
         }
     }
 
@@ -3274,20 +3232,15 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $this->set_no_cache('no_cache has been set before the page was generated - safety check', true);
         }
         // Hook for post-processing of page content cached/non-cached:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         // Processing if caching is enabled:
         if (!$this->no_cache) {
             // Hook for post-processing of page content before being cached:
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'])) {
-                $_params = ['pObj' => &$this];
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'] as $_funcRef) {
-                    GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'] ?? [] as $_funcRef) {
+                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
         }
         // Convert char-set for output: (should be BEFORE indexing of the content (changed 22/4 2005)),
@@ -3297,11 +3250,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         // to utf-8 so the content MUST be in metaCharset already!
         $this->content = $this->convOutputCharset($this->content);
         // Hook for indexing pages
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] as $className) {
-                $_procObj = GeneralUtility::makeInstance($className);
-                $_procObj->hook_indexContent($this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] ?? [] as $className) {
+            $_procObj = GeneralUtility::makeInstance($className);
+            $_procObj->hook_indexContent($this);
         }
         // Storing for cache:
         if (!$this->no_cache) {
@@ -3492,11 +3443,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         // Initialize by status if there is a Redirect URL
         $enableOutput = empty($this->activeUrlHandlers);
         // Call hook for possible disabling of output:
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'])) {
-            $_params = ['pObj' => &$this, 'enableOutput' => &$enableOutput];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this, 'enableOutput' => &$enableOutput];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         return $enableOutput;
     }
@@ -3535,11 +3484,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $this->contentStrReplace();
         }
         // Hook for post-processing of page content before output:
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -3636,17 +3583,12 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $replace[] = $this->fe_user->get_URL_ID;
         }
         // Hook for supplying custom search/replace data
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'])) {
-            $contentStrReplaceHooks = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'];
-            if (is_array($contentStrReplaceHooks)) {
-                $_params = [
-                    'search' => &$search,
-                    'replace' => &$replace
-                ];
-                foreach ($contentStrReplaceHooks as $_funcRef) {
-                    GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'] ?? [] as $_funcRef) {
+            $_params = [
+                'search' => &$search,
+                'replace' => &$replace
+            ];
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
         if (!empty($search)) {
             $this->content = str_replace($search, $replace, $this->content);
@@ -3668,11 +3610,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     {
         if ($this->fePreview !== 0) {
             $previewInfo = '';
-            if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'])) {
-                $_params = ['pObj' => &$this];
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'] as $_funcRef) {
-                    $previewInfo .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+            $_params = ['pObj' => &$this];
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'] ?? [] as $_funcRef) {
+                $previewInfo .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
             $this->content = str_ireplace('</body>', $previewInfo . '</body>', $this->content);
         }
@@ -3683,12 +3623,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      */
     public function hook_eofe()
     {
-        // Call hook for end-of-frontend processing:
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'])) {
-            $_params = ['pObj' => &$this];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] as $_funcRef) {
-                GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-            }
+        $_params = ['pObj' => &$this];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] ?? [] as $_funcRef) {
+            GeneralUtility::callUserFunction($_funcRef, $_params, $this);
         }
     }
 
@@ -4048,11 +3985,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             // Calculate the timeout time for records on the page and adjust cache timeout if necessary
             $cacheTimeout = min($this->calculatePageCacheTimeout(), $cacheTimeout);
 
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['get_cache_timeout'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['get_cache_timeout'] as $_funcRef) {
-                    $params = ['cacheTimeout' => $cacheTimeout];
-                    $cacheTimeout = GeneralUtility::callUserFunction($_funcRef, $params, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['get_cache_timeout'] ?? [] as $_funcRef) {
+                $params = ['cacheTimeout' => $cacheTimeout];
+                $cacheTimeout = GeneralUtility::callUserFunction($_funcRef, $params, $this);
             }
             $runtimeCache->set($cachedCacheLifetimeIdentifier, $cacheTimeout);
             $cachedCacheLifetime = $cacheTimeout;
index cd45d4e..8990f17 100644 (file)
@@ -29,11 +29,9 @@ class MediaItemHooks implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function customMediaRenderTypes(&$params, $conf)
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                $hookObj->customMediaRenderTypes($params, $conf);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            $hookObj->customMediaRenderTypes($params, $conf);
         }
     }
 
@@ -45,11 +43,9 @@ class MediaItemHooks implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function customMediaParams(&$params, $conf)
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'] as $className) {
-                $hookObj = GeneralUtility::makeInstance($className);
-                $hookObj->customMediaParams($params, $conf);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'] ?? [] as $className) {
+            $hookObj = GeneralUtility::makeInstance($className);
+            $hookObj->customMediaParams($params, $conf);
         }
     }
 }
index dc56bab..8af138e 100644 (file)
@@ -61,13 +61,9 @@ class EidRequestHandler implements RequestHandlerInterface
         $timeTracker->start();
 
         // Hook to preprocess the current request
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
-                $hookParameters = [];
-                GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
-            }
-            unset($hookFunction);
-            unset($hookParameters);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] ?? [] as $hookFunction) {
+            $hookParameters = [];
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
         }
 
         // Remove any output produced until now
index 17e70e2..4fd5332 100644 (file)
@@ -85,13 +85,9 @@ class RequestHandler implements RequestHandlerInterface
         $this->initializeTimeTracker();
 
         // Hook to preprocess the current request:
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
-                $hookParameters = [];
-                GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
-            }
-            unset($hookFunction);
-            unset($hookParameters);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] ?? [] as $hookFunction) {
+            $hookParameters = [];
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
         }
 
         $this->initializeController();
index 2c60017..69aaf05 100644 (file)
@@ -121,11 +121,9 @@ class GifBuilder extends GraphicalFunctions
             // Let's you pre-process the gifbuilder configuration. for
             // example you can split a string up into lines and render each
             // line as TEXT obj, see extension julle_gifbconf
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_gifbuilder.php']['gifbuilder-ConfPreProcess'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_gifbuilder.php']['gifbuilder-ConfPreProcess'] as $_funcRef) {
-                    $_params = $this->setup;
-                    $this->setup = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_gifbuilder.php']['gifbuilder-ConfPreProcess'] ?? [] as $_funcRef) {
+                $_params = $this->setup;
+                $this->setup = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
             // Initializing global Char Range Map
             $this->charRangeMap = [];
index 0d2a44d..1ede524 100644 (file)
@@ -244,14 +244,12 @@ class PageRepository implements LoggerAwareInterface
     public function getPage($uid, $disableGroupAccessCheck = false)
     {
         // Hook to manipulate the page uid for special overlay handling
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof PageRepositoryGetPageHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetPageHookInterface::class, 1251476766);
-                }
-                $hookObject->getPage_preProcess($uid, $disableGroupAccessCheck, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof PageRepositoryGetPageHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetPageHookInterface::class, 1251476766);
             }
+            $hookObject->getPage_preProcess($uid, $disableGroupAccessCheck, $this);
         }
         $cacheKey = md5(
             implode(
@@ -432,18 +430,16 @@ class PageRepository implements LoggerAwareInterface
             $lUid = $this->sys_language_uid;
         }
         $row = null;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'])) {
-            foreach ($pagesInput as &$origPage) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] as $className) {
-                    $hookObject = GeneralUtility::makeInstance($className);
-                    if (!$hookObject instanceof PageRepositoryGetPageOverlayHookInterface) {
-                        throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetPageOverlayHookInterface::class, 1269878881);
-                    }
-                    $hookObject->getPageOverlay_preProcess($origPage, $lUid, $this);
+        foreach ($pagesInput as &$origPage) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] ?? [] as $className) {
+                $hookObject = GeneralUtility::makeInstance($className);
+                if (!$hookObject instanceof PageRepositoryGetPageOverlayHookInterface) {
+                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetPageOverlayHookInterface::class, 1269878881);
                 }
+                $hookObject->getPageOverlay_preProcess($origPage, $lUid, $this);
             }
-            unset($origPage);
         }
+        unset($origPage);
         // If language UID is different from zero, do overlay:
         if ($lUid) {
             $page_ids = [];
@@ -532,14 +528,12 @@ class PageRepository implements LoggerAwareInterface
      */
     public function getRecordOverlay($table, $row, $sys_language_content, $OLmode = '')
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof PageRepositoryGetRecordOverlayHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881658);
-                }
-                $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof PageRepositoryGetRecordOverlayHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881658);
             }
+            $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
         }
         if ($row['uid'] > 0 && ($row['pid'] > 0 || in_array($table, $this->tableNamesAllowedOnRootLevel, true))) {
             if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['languageField'] && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) {
@@ -615,14 +609,12 @@ class PageRepository implements LoggerAwareInterface
                 }
             }
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof PageRepositoryGetRecordOverlayHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881659);
-                }
-                $hookObject->getRecordOverlay_postProcess($table, $row, $sys_language_content, $OLmode, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof PageRepositoryGetRecordOverlayHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . PageRepositoryGetRecordOverlayHookInterface::class, 1269881659);
             }
+            $hookObject->getRecordOverlay_postProcess($table, $row, $sys_language_content, $OLmode, $this);
         }
         return $row;
     }
@@ -1377,18 +1369,16 @@ class PageRepository implements LoggerAwareInterface
                     // Call hook functions for additional enableColumns
                     // It is used by the extension ingmar_accessctrl which enables assigning more
                     // than one usergroup to content and page records
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'])) {
-                        $_params = [
-                            'table' => $table,
-                            'show_hidden' => $show_hidden,
-                            'ignore_array' => $ignore_array,
-                            'ctrl' => $ctrl
-                        ];
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'] as $_funcRef) {
-                            $constraints[] = QueryHelper::stripLogicalOperatorPrefix(
-                                GeneralUtility::callUserFunction($_funcRef, $_params, $this)
-                            );
-                        }
+                    $_params = [
+                        'table' => $table,
+                        'show_hidden' => $show_hidden,
+                        'ignore_array' => $ignore_array,
+                        'ctrl' => $ctrl
+                    ];
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'] ?? [] as $_funcRef) {
+                        $constraints[] = QueryHelper::stripLogicalOperatorPrefix(
+                            GeneralUtility::callUserFunction($_funcRef, $_params, $this)
+                        );
                     }
                 }
             }
index 263fd87..887e9f9 100644 (file)
@@ -517,16 +517,12 @@ class AbstractPlugin
      */
     public function pi_list_browseresults($showResultCount = 1, $tableParams = '', $wrapArr = [], $pointerName = 'pointer', $hscText = true, $forceOutput = false)
     {
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['pi_list_browseresults'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['pi_list_browseresults'])
-        ) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['pi_list_browseresults'] as $classRef) {
-                $hookObj = GeneralUtility::makeInstance($classRef);
-                if (method_exists($hookObj, 'pi_list_browseresults')) {
-                    $pageBrowser = $hookObj->pi_list_browseresults($showResultCount, $tableParams, $wrapArr, $pointerName, $hscText, $forceOutput, $this);
-                    if (is_string($pageBrowser) && trim($pageBrowser) !== '') {
-                        return $pageBrowser;
-                    }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['pi_list_browseresults'] ?? [] as $classRef) {
+            $hookObj = GeneralUtility::makeInstance($classRef);
+            if (method_exists($hookObj, 'pi_list_browseresults')) {
+                $pageBrowser = $hookObj->pi_list_browseresults($showResultCount, $tableParams, $wrapArr, $pointerName, $hscText, $forceOutput, $this);
+                if (is_string($pageBrowser) && trim($pageBrowser) !== '') {
+                    return $pageBrowser;
                 }
             }
         }
index e1464f5..bbfccf5 100644 (file)
@@ -155,14 +155,11 @@ abstract class AbstractTypolinkBuilder
      */
     protected function processUrl(string $context, string $url, array $typolinkConfiguration = [])
     {
-        if (
-            empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'])
-            || !is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'])
-        ) {
+        $urlProcessors = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'] ?? false;
+        if (!$urlProcessors) {
             return $url;
         }
 
-        $urlProcessors = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'];
         foreach ($urlProcessors as $identifier => $configuration) {
             if (empty($configuration) || !is_array($configuration)) {
                 throw new \RuntimeException('Missing configuration for URI processor "' . $identifier . '".', 1491130459);
index 5391792..01c3ec9 100644 (file)
@@ -54,15 +54,13 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
             throw new UnableToLinkException('Page id "' . $linkDetails['typoLinkParameter'] . '" was not found, so "' . $linkText . '" was not linked.', 1490987336, null, $linkText);
         }
 
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typolinkProcessing']['typolinkModifyParameterForPageLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typolinkProcessing']['typolinkModifyParameterForPageLinks'] as $classData) {
-                $hookObject = GeneralUtility::makeInstance($classData);
-                if (!$hookObject instanceof TypolinkModifyLinkConfigForPageLinksHookInterface) {
-                    throw new \UnexpectedValueException('$hookObject must implement interface ' . TypolinkModifyLinkConfigForPageLinksHookInterface::class, 1483114905);
-                }
-                /** @var $hookObject TypolinkModifyLinkConfigForPageLinksHookInterface */
-                $conf = $hookObject->modifyPageLinkConfiguration($conf, $linkDetails, $page);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typolinkProcessing']['typolinkModifyParameterForPageLinks'] ?? [] as $classData) {
+            $hookObject = GeneralUtility::makeInstance($classData);
+            if (!$hookObject instanceof TypolinkModifyLinkConfigForPageLinksHookInterface) {
+                throw new \UnexpectedValueException('$hookObject must implement interface ' . TypolinkModifyLinkConfigForPageLinksHookInterface::class, 1483114905);
             }
+            /** @var $hookObject TypolinkModifyLinkConfigForPageLinksHookInterface */
+            $conf = $hookObject->modifyPageLinkConfiguration($conf, $linkDetails, $page);
         }
         $enableLinksAcrossDomains = $tsfe->config['config']['typolinkEnableLinksAcrossDomains'];
         if ($conf['no_cache.']) {
index eafc752..76b21e5 100644 (file)
@@ -290,20 +290,18 @@ class AdminPanelView
         $moduleContent .= $this->getModule('tsdebug', $this->getTSDebugModule());
         $moduleContent .= $this->getModule('info', $this->getInfoModule());
 
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof AdminPanelViewHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . AdminPanelViewHookInterface::class, 1311942539);
-                }
-                $content = $hookObject->extendAdminPanel($moduleContent, $this);
-                if ($content) {
-                    $moduleContent .= '<div class="typo3-adminPanel-section typo3-adminPanel-section-open">';
-                    $moduleContent .= '  <div class="typo3-adminPanel-section-body">';
-                    $moduleContent .= '    ' . $content;
-                    $moduleContent .= '  </div>';
-                    $moduleContent .= '</div>';
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof AdminPanelViewHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . AdminPanelViewHookInterface::class, 1311942539);
+            }
+            $content = $hookObject->extendAdminPanel($moduleContent, $this);
+            if ($content) {
+                $moduleContent .= '<div class="typo3-adminPanel-section typo3-adminPanel-section-open">';
+                $moduleContent .= '  <div class="typo3-adminPanel-section-body">';
+                $moduleContent .= '    ' . $content;
+                $moduleContent .= '  </div>';
+                $moduleContent .= '</div>';
             }
         }
 
index 74c8131..bff4008 100644 (file)
@@ -1215,10 +1215,8 @@ abstract class ImportExport
      */
     public function callHook($name, $params)
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php'][$name])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php'][$name] as $hook) {
-                GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php'][$name] ?? [] as $hook) {
+            GeneralUtility::callUserFunction($hook, $params, $this);
         }
     }
 
index 7397df7..a9bc649 100644 (file)
@@ -492,13 +492,11 @@ class AdministrationController extends ActionController
      */
     public function statisticAction($depth = 1, $mode = 'overview')
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $className) {
-                /** @var \TYPO3\CMS\IndexedSearch\FileContentParser $fileContentParser */
-                $fileContentParser = GeneralUtility::makeInstance($className);
-                if ($fileContentParser->softInit($extension)) {
-                    $this->external_parsers[$extension] = $fileContentParser;
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] ?? [] as $extension => $className) {
+            /** @var \TYPO3\CMS\IndexedSearch\FileContentParser $fileContentParser */
+            $fileContentParser = GeneralUtility::makeInstance($className);
+            if ($fileContentParser->softInit($extension)) {
+                $this->external_parsers[$extension] = $fileContentParser;
             }
         }
         $this->administrationRepository->external_parsers = $this->external_parsers;
index eba34aa..fbe71c3 100644 (file)
@@ -1479,13 +1479,11 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
     protected function initializeExternalParsers()
     {
         // Initialize external document parsers for icon display and other soft operations
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $className) {
-                $this->externalParsers[$extension] = GeneralUtility::makeInstance($className);
-                // Init parser and if it returns FALSE, unset its entry again
-                if (!$this->externalParsers[$extension]->softInit($extension)) {
-                    unset($this->externalParsers[$extension]);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] ?? [] as $extension => $className) {
+            $this->externalParsers[$extension] = GeneralUtility::makeInstance($className);
+            // Init parser and if it returns FALSE, unset its entry again
+            if (!$this->externalParsers[$extension]->softInit($extension)) {
+                unset($this->externalParsers[$extension]);
             }
         }
     }
index 25f9975..bec21d0 100644 (file)
@@ -806,9 +806,9 @@ class IndexSearchRepository
                 $expressionBuilder->in('ISEC.rl2', GeneralUtility::intExplode(',', substr($this->sections, 4)))
             );
             $match = true;
-        } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) {
+        } else {
             // Traversing user configured fields to see if any of those are used to limit search to a section:
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) {
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] ?? [] as $fieldName => $rootLineLevel) {
                 if (substr($this->sections, 0, strlen($fieldName) + 1) == $fieldName . '_') {
                     $whereClause->add(
                         $expressionBuilder->in(
index 8c2882e..57c0dbc 100644 (file)
@@ -504,14 +504,12 @@ class Indexer
      */
     public function initializeExternalParsers()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] as $extension => $className) {
-                $this->external_parsers[$extension] = GeneralUtility::makeInstance($className);
-                $this->external_parsers[$extension]->pObj = $this;
-                // Init parser and if it returns FALSE, unset its entry again:
-                if (!$this->external_parsers[$extension]->initParser($extension)) {
-                    unset($this->external_parsers[$extension]);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] ?? [] as $extension => $className) {
+            $this->external_parsers[$extension] = GeneralUtility::makeInstance($className);
+            $this->external_parsers[$extension]->pObj = $this;
+            // Init parser and if it returns FALSE, unset its entry again:
+            if (!$this->external_parsers[$extension]->initParser($extension)) {
+                unset($this->external_parsers[$extension]);
             }
         }
     }
@@ -2062,10 +2060,8 @@ class Indexer
         $fieldArray['rl0'] = (int)$this->conf['rootline_uids'][0];
         $fieldArray['rl1'] = (int)$this->conf['rootline_uids'][1];
         $fieldArray['rl2'] = (int)$this->conf['rootline_uids'][2];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) {
-                $fieldArray[$fieldName] = (int)$this->conf['rootline_uids'][$rootLineLevel];
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] ?? [] as $fieldName => $rootLineLevel) {
+            $fieldArray[$fieldName] = (int)$this->conf['rootline_uids'][$rootLineLevel];
         }
     }
 
index 1fa66bf..bfebaa3 100644 (file)
@@ -115,12 +115,9 @@ class PageInformationController extends \TYPO3\CMS\Backend\Module\AbstractFuncti
             . $dblist->HTMLcode;
 
         // Additional footer content
-        $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
-        if (is_array($footerContentHook)) {
-            foreach ($footerContentHook as $hook) {
-                $params = [];
-                $theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'] ?? [] as $hook) {
+            $params = [];
+            $theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
         }
         return $theOutput;
     }
index 21d4545..4c37b1f 100644 (file)
@@ -106,10 +106,8 @@ class LinkAnalyzer
     {
         $this->getLanguageService()->includeLLFile('EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf');
         // Hook to handle own checks
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $key => $className) {
-                $this->hookObjectsArr[$key] = GeneralUtility::makeInstance($className);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $key => $className) {
+            $this->hookObjectsArr[$key] = GeneralUtility::makeInstance($className);
         }
     }
 
index 9a31f6b..a4b1230 100644 (file)
@@ -162,20 +162,18 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
         } else {
             $this->searchLevel = $this->pObj->MOD_SETTINGS['searchlevel'];
         }
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
-                // Compile list of all available types. Used for checking with button "Check Links".
-                if (strpos($this->modTS['linktypes'], $linkType) !== false) {
-                    $this->availableOptions[$linkType] = 1;
-                }
-                // Compile list of types currently selected by the checkboxes
-                if ($this->pObj->MOD_SETTINGS[$linkType] && empty($set) || $set[$linkType]) {
-                    $this->checkOpt[$linkType] = 1;
-                    $this->pObj->MOD_SETTINGS[$linkType] = 1;
-                } else {
-                    $this->pObj->MOD_SETTINGS[$linkType] = 0;
-                    unset($this->checkOpt[$linkType]);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $linkType => $value) {
+            // Compile list of all available types. Used for checking with button "Check Links".
+            if (strpos($this->modTS['linktypes'], $linkType) !== false) {
+                $this->availableOptions[$linkType] = 1;
+            }
+            // Compile list of types currently selected by the checkboxes
+            if ($this->pObj->MOD_SETTINGS[$linkType] && empty($set) || $set[$linkType]) {
+                $this->checkOpt[$linkType] = 1;
+                $this->pObj->MOD_SETTINGS[$linkType] = 1;
+            } else {
+                $this->pObj->MOD_SETTINGS[$linkType] = 0;
+                unset($this->checkOpt[$linkType]);
             }
         }
         $this->getBackendUser()->pushModuleData('web_info', $this->pObj->MOD_SETTINGS);
@@ -235,10 +233,8 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
      */
     protected function initialize()
     {
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $className) {
-                $this->hookObjectsArr[$linkType] = GeneralUtility::makeInstance($className);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $linkType => $className) {
+            $this->hookObjectsArr[$linkType] = GeneralUtility::makeInstance($className);
         }
 
         $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
index b3c0cc0..b538f0e 100644 (file)
@@ -411,15 +411,9 @@ class ValidatorTask extends AbstractTask
     {
         $linkTypes = [];
         $typesTmp = GeneralUtility::trimExplode(',', $modTS['linktypes'], true);
-        if (is_array($typesTmp)) {
-            if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
-            ) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
-                    if (in_array($type, $typesTmp)) {
-                        $linkTypes[$type] = 1;
-                    }
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] ?? [] as $type => $value) {
+            if (in_array($type, $typesTmp)) {
+                $linkTypes[$type] = 1;
             }
         }
         return $linkTypes;
@@ -446,19 +440,16 @@ class ValidatorTask extends AbstractTask
         $markerArray['totalBrokenLink'] = $this->totalBrokenLink;
         $markerArray['totalBrokenLink_old'] = $this->oldTotalBrokenLink;
 
-        // Hook
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['reportEmailMarkers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['reportEmailMarkers'] as $userFunc) {
-                $params = [
-                    'pObj' => &$this,
-                    'markerArray' => $markerArray
-                ];
-                $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this);
-                if (is_array($newMarkers)) {
-                    $markerArray = $newMarkers + $markerArray;
-                }
-                unset($params);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['reportEmailMarkers'] ?? [] as $userFunc) {
+            $params = [
+                'pObj' => &$this,
+                'markerArray' => $markerArray
+            ];
+            $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this);
+            if (is_array($newMarkers)) {
+                $markerArray = $newMarkers + $markerArray;
             }
+            unset($params);
         }
         $content = $this->templateService->substituteMarkerArray($content, $markerArray, '###|###', true, true);
         /** @var $mail MailMessage */
@@ -532,33 +523,28 @@ class ValidatorTask extends AbstractTask
     protected function buildMail($curPage, $pageList, array $markerArray, array $oldBrokenLink)
     {
         $pageSectionHtml = $this->templateService->getSubpart($this->templateMail, '###PAGE_SECTION###');
-        // Hook
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['buildMailMarkers'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['buildMailMarkers'] as $userFunc) {
-                $params = [
-                    'curPage' => $curPage,
-                    'pageList' => $pageList,
-                    'markerArray' => $markerArray,
-                    'oldBrokenLink' => $oldBrokenLink,
-                    'pObj' => &$this
-                ];
-                $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this);
-                if (is_array($newMarkers)) {
-                    $markerArray = $newMarkers + $markerArray;
-                }
-                unset($params);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['buildMailMarkers'] ?? [] as $userFunc) {
+            $params = [
+                'curPage' => $curPage,
+                'pageList' => $pageList,
+                'markerArray' => $markerArray,
+                'oldBrokenLink' => $oldBrokenLink,
+                'pObj' => &$this
+            ];
+            $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this);
+            if (is_array($newMarkers)) {
+                $markerArray = $newMarkers + $markerArray;
             }
+            unset($params);
         }
-        if (is_array($markerArray)) {
-            foreach ($markerArray as $markerKey => $markerValue) {
-                if (empty($oldBrokenLink[$markerKey])) {
-                    $oldBrokenLink[$markerKey] = 0;
-                }
-                if ($markerValue != $oldBrokenLink[$markerKey]) {
-                    $this->isDifferentToLastRun = true;
-                }
-                $markerArray[$markerKey . '_old'] = $oldBrokenLink[$markerKey];
+        foreach ($markerArray as $markerKey => $markerValue) {
+            if (empty($oldBrokenLink[$markerKey])) {
+                $oldBrokenLink[$markerKey] = 0;
+            }
+            if ($markerValue != $oldBrokenLink[$markerKey]) {
+                $this->isDifferentToLastRun = true;
             }
+            $markerArray[$markerKey . '_old'] = $oldBrokenLink[$markerKey];
         }
         $markerArray['title'] = BackendUtility::getRecordTitle(
             'pages',
index fe40625..08246c0 100644 (file)
@@ -134,15 +134,11 @@ abstract class AbstractLinkBrowserController
      */
     protected function initHookObjects()
     {
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks'])
-        ) {
-            $hooks = GeneralUtility::makeInstance(DependencyOrderingService::class)->orderByDependencies(
-                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks']
-            );
-            foreach ($hooks as $key => $hook) {
-                $this->hookObjects[] = GeneralUtility::makeInstance($hook['handler']);
-            }
+        $hooks = GeneralUtility::makeInstance(DependencyOrderingService::class)->orderByDependencies(
+            $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks'] ?? []
+        );
+        foreach ($hooks as $key => $hook) {
+            $this->hookObjects[] = GeneralUtility::makeInstance($hook['handler']);
         }
     }
 
index 7fe9687..8d77b88 100644 (file)
@@ -102,15 +102,13 @@ class ElementBrowserController
 
         // Render type by user func
         $browserRendered = false;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $className) {
-                $browserRenderObj = GeneralUtility::makeInstance($className);
-                if (method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
-                    if ($browserRenderObj->isValid($this->mode, $this)) {
-                        $content = $browserRenderObj->render($this->mode, $this);
-                        $browserRendered = true;
-                        break;
-                    }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] ?? [] as $className) {
+            $browserRenderObj = GeneralUtility::makeInstance($className);
+            if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
+                if ($browserRenderObj->isValid($this->mode, $this)) {
+                    $content = $browserRenderObj->render($this->mode, $this);
+                    $browserRendered = true;
+                    break;
                 }
             }
         }
index 541fc92..183dc28 100644 (file)
@@ -540,12 +540,9 @@ class RecordList
             $this->body .= '<div class="db_list-dashboard">' . $dblist->clipObj->printClipboard() . '</div>';
         }
         // Additional footer content
-        $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook'];
-        if (is_array($footerContentHook)) {
-            foreach ($footerContentHook as $hook) {
-                $params = [];
-                $this->body .= GeneralUtility::callUserFunction($hook, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook'] ?? [] as $hook) {
+            $params = [];
+            $this->body .= GeneralUtility::callUserFunction($hook, $params, $this);
         }
         // Setting up the buttons for docheader
         $dblist->getDocHeaderButtons($this->moduleTemplate);
index 1a352a2..856f281 100644 (file)
@@ -1008,16 +1008,14 @@ class AbstractDatabaseRecordList extends AbstractRecordList
             $fieldListWasSet = true;
         }
         // Call hook to add or change the list
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['mod_list']['getSearchFieldList'])) {
-            $hookParameters = [
-                'tableHasSearchConfiguration' => $fieldListWasSet,
-                'tableName' => $tableName,
-                'searchFields' => &$fieldArray,
-                'searchString' => $this->searchString
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['mod_list']['getSearchFieldList'] as $hookFunction) {
-                GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-            }
+        $hookParameters = [
+            'tableHasSearchConfiguration' => $fieldListWasSet,
+            'tableName' => $tableName,
+            'searchFields' => &$fieldArray,
+            'searchString' => $this->searchString
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['mod_list']['getSearchFieldList'] ?? [] as $hookFunction) {
+            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
         }
         return $fieldArray;
     }
index 73a67de..acd5fac 100644 (file)
@@ -1031,14 +1031,12 @@ class DatabaseRecordList
         // Implode it into a list of fields for the SQL-statement.
         $selFieldList = implode(',', $selectFields);
         $this->selFieldList = $selFieldList;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof RecordListGetTableHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListGetTableHookInterface::class, 1195114460);
-                }
-                $hookObject->getDBlistQuery($table, $id, $addWhere, $selFieldList, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof RecordListGetTableHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListGetTableHookInterface::class, 1195114460);
             }
+            $hookObject->getDBlistQuery($table, $id, $addWhere, $selFieldList, $this);
         }
         $additionalConstraints = empty($addWhere) ? [] : [QueryHelper::stripLogicalOperatorPrefix($addWhere)];
         $selFieldList = GeneralUtility::trimExplode(',', $selFieldList, true);
@@ -1613,14 +1611,12 @@ class DatabaseRecordList
                      *        (shown above the clipboard checkboxes when a clipboard other than "Normal" is selected),
                      *        or other "Action" functions which perform operations on the listed records.
                      */
-                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
-                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
-                            $hookObject = GeneralUtility::makeInstance($className);
-                            if (!$hookObject instanceof RecordListHookInterface) {
-                                throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567850);
-                            }
-                            $cells = $hookObject->renderListHeaderActions($table, $currentIdList, $cells, $this);
+                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] ?? [] as $className) {
+                        $hookObject = GeneralUtility::makeInstance($className);
+                        if (!$hookObject instanceof RecordListHookInterface) {
+                            throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567850);
                         }
+                        $cells = $hookObject->renderListHeaderActions($table, $currentIdList, $cells, $this);
                     }
                     $theData[$fCol] = '';
                     if (isset($cells['edit']) && isset($cells['delete'])) {
@@ -1736,14 +1732,12 @@ class DatabaseRecordList
          *        Containing the labels of all shown fields and additional icons to create new records for this
          *        table or perform special clipboard tasks like mark and copy all listed records to clipboard, etc.
          */
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof RecordListHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567855);
-                }
-                $theData = $hookObject->renderListHeader($table, $currentIdList, $theData, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof RecordListHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567855);
             }
+            $theData = $hookObject->renderListHeader($table, $currentIdList, $theData, $this);
         }
 
         // Create and return header table row:
@@ -2119,10 +2113,11 @@ class DatabaseRecordList
         /*
          * hook: recStatInfoHooks: Allows to insert HTML before record icons on various places
          */
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
+        $hooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] ?? [];
+        if (!empty($hooks)) {
             $stat = '';
             $_params = [$table, $row['uid']];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
+            foreach ($hooks as $_funcRef) {
                 $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
             }
             $this->addActionToCellGroup($cells, $stat, 'stat');
@@ -2134,7 +2129,7 @@ class DatabaseRecordList
          *        Each array entry is accessible by an index-key.
          *        The order of the icons is depending on the order of those array entries.
          */
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
+        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] ?? false)) {
             // for compatibility reason, we move all icons to the rootlevel
             // before calling the hooks
             foreach ($cells as $section => $actions) {
@@ -2304,14 +2299,12 @@ class DatabaseRecordList
          *        Each array entry is accessible by an index-key.
          *        The order of the icons is depending on the order of those array entries.
          */
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (!$hookObject instanceof RecordListHookInterface) {
-                    throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567845);
-                }
-                $cells = $hookObject->makeClip($table, $row, $cells, $this);
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (!$hookObject instanceof RecordListHookInterface) {
+                throw new \UnexpectedValueException($className . ' must implement interface ' . RecordListHookInterface::class, 1195567845);
             }
+            $cells = $hookObject->makeClip($table, $row, $cells, $this);
         }
         return '<div class="btn-group" role="group">' . implode('', $cells) . '</div>';
     }
index 6a20542..d411ca1 100644 (file)
@@ -97,20 +97,7 @@ class ReportController extends ActionController
     public function detailAction($extension, $report)
     {
         $content = ($error = '');
-        $reportClass = null;
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension])
-            && isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report])
-            && isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'])
-        ) {
-            $reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'];
-        }
-
-        // If extension has been uninstalled/removed redirect to index
-        if ($reportClass === null) {
-            $this->redirect('index');
-        }
+        $reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'] ?? $this->redirect('index');
 
         $reportInstance = GeneralUtility::makeInstance($reportClass, $this);
         if ($reportInstance instanceof ReportInterface) {
index 1aea9be..101a3c8 100644 (file)
@@ -102,15 +102,14 @@ class ConfigurationStatus implements StatusProviderInterface
      */
     protected function getConfiguredMemcachedServers()
     {
+        $configurations = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] ?? [];
         $memcachedServers = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $table => $conf) {
-                if (is_array($conf)) {
-                    foreach ($conf as $key => $value) {
-                        if (!is_array($value) && $value === \TYPO3\CMS\Core\Cache\Backend\MemcachedBackend::class) {
-                            $memcachedServers = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$table]['options']['servers'];
-                            break;
-                        }
+        foreach ($configurations as $table => $conf) {
+            if (is_array($conf)) {
+                foreach ($conf as $key => $value) {
+                    if ($value === \TYPO3\CMS\Core\Cache\Backend\MemcachedBackend::class) {
+                        $memcachedServers = $configurations[$table]['options']['servers'];
+                        break;
                     }
                 }
             }
index 9c8eacb..df78f2f 100644 (file)
@@ -1358,17 +1358,15 @@ class SchedulerModuleController
     protected function getRegisteredClasses()
     {
         $list = [];
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'] as $class => $registrationInformation) {
-                $title = isset($registrationInformation['title']) ? $this->getLanguageService()->sL($registrationInformation['title']) : '';
-                $description = isset($registrationInformation['description']) ? $this->getLanguageService()->sL($registrationInformation['description']) : '';
-                $list[$class] = [
-                    'extension' => $registrationInformation['extension'],
-                    'title' => $title,
-                    'description' => $description,
-                    'provider' => isset($registrationInformation['additionalFields']) ? $registrationInformation['additionalFields'] : ''
-                ];
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'] ?? [] as $class => $registrationInformation) {
+            $title = isset($registrationInformation['title']) ? $this->getLanguageService()->sL($registrationInformation['title']) : '';
+            $description = isset($registrationInformation['description']) ? $this->getLanguageService()->sL($registrationInformation['description']) : '';
+            $list[$class] = [
+                'extension' => $registrationInformation['extension'],
+                'title' => $title,
+                'description' => $description,
+                'provider' => isset($registrationInformation['additionalFields']) ? $registrationInformation['additionalFields'] : ''
+            ];
         }
         return $list;
     }
index 3479b9d..4e177c8 100644 (file)
@@ -147,10 +147,8 @@ class OptimizeDatabaseTableAdditionalFieldProvider implements AdditionalFieldPro
         $optimizableTables = $this->getOptimizableTablesForConnection($defaultConnection);
 
         // Retrieve additional optimizable tables that have been remapped to a different connection
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'])
-        ) {
-            $tableMap = $GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'];
+        $tableMap = $GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'] ?? false;
+        if ($tableMap) {
             // Remove all remapped tables from the list of optimizable tables
             // These tables will be rechecked and possibly re-added to the list
             // of optimizable tables. This ensures that no orphaned table from
index 5a18781..b5f8bad 100644 (file)
@@ -56,14 +56,8 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Sched
 // Save any previous option array for table garbage collection task
 // to temporary variable so it can be pre-populated by other
 // extensions and LocalConfiguration/AdditionalConfiguration
-$garbageCollectionTaskOptions = [];
-if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options'])) {
-    $garbageCollectionTaskOptions = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options'];
-}
-// Initialize tables sub-array if not set already
-if (!is_array($garbageCollectionTaskOptions['tables'])) {
-    $garbageCollectionTaskOptions['tables'] = [];
-}
+$garbageCollectionTaskOptions = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options'] ?? [];
+$garbageCollectionTaskOptions['tables'] = $garbageCollectionTaskOptions['tables'] ?? [];
 // Add table garbage collection task
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class] = [
     'extension' => 'scheduler',
@@ -75,14 +69,14 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Sched
 unset($garbageCollectionTaskOptions);
 
 // Register sys_log and sys_history table in table garbage collection task
-if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_log'])) {
+if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_log'] ?? false)) {
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_log'] = [
         'dateField' => 'tstamp',
         'expirePeriod' => 180
     ];
 }
 
-if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_history'])) {
+if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_history'] ?? false)) {
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_history'] = [
         'dateField' => 'tstamp',
         'expirePeriod' => 30
index a7904ef..128fe2b 100644 (file)
@@ -256,11 +256,9 @@ class SetupModuleController
                 // If email and name is changed, set it in the users record:
                 $be_user_data = $d['be_users'];
                 // Possibility to modify the transmitted values. Useful to do transformations, like RSA password decryption
-                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['modifyUserDataBeforeSave'])) {
-                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['modifyUserDataBeforeSave'] as $function) {
-                        $params = ['be_user_data' => &$be_user_data];
-                        GeneralUtility::callUserFunction($function, $params, $this);
-                    }
+                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['modifyUserDataBeforeSave'] ?? [] as $function) {
+                    $params = ['be_user_data' => &$be_user_data];
+                    GeneralUtility::callUserFunction($function, $params, $this);
                 }
                 $this->passwordIsSubmitted = (string)$be_user_data['password'] !== '';
                 $passwordIsConfirmed = $this->passwordIsSubmitted && $be_user_data['password'] === $be_user_data['password2'];
@@ -364,11 +362,9 @@ class SetupModuleController
     protected function getJavaScript()
     {
         $javaScript = '';
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['setupScriptHook'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['setupScriptHook'] as $function) {
-                $params = [];
-                $javaScript .= GeneralUtility::callUserFunction($function, $params, $this);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/setup/mod/index.php']['setupScriptHook'] ?? [] as $function) {
+            $params = [];
+            $javaScript .= GeneralUtility::callUserFunction($function, $params, $this);
         }
         return $javaScript;
     }
index 372590a..a4620bf 100644 (file)
@@ -67,10 +67,8 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
         $this->moduleUrl = BackendUtility::getModuleUrl('user_task');
         $this->taskObject = $taskObject;
         $this->getLanguageService()->includeLLFile('EXT:sys_action/Resources/Private/Language/locallang.xlf');
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'] as $className) {
-                $this->hookObjects[] = GeneralUtility::makeInstance($className);
-            }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sys_action']['tx_sysaction_task'] ?? [] as $className) {
+            $this->hookObjects[] = GeneralUtility::makeInstance($className);
         }
     }
 
index 6ba9c2d..6a3e64c 100644 (file)
@@ -350,7 +350,7 @@ class TaskModuleController extends BaseScriptClass
         $tasks = [];
         $defaultIcon = 'EXT:taskcenter/Resources/Public/Icons/module-taskcenter.svg';
         // Render the tasks only if there are any available
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']) && !empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'])) {
+        if (count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'] ?? [])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'] as $extKey => $extensionReports) {
                 foreach ($extensionReports as $taskClass => $task) {
                     if (!$this->checkAccess($extKey, $taskClass)) {
index 79df01f..61207c8 100644 (file)
@@ -241,12 +241,10 @@ class RemoteServer extends AbstractHandler
         }
         // Hook for modifying the difference and live arrays
         // (this may be used by custom or dynamically-defined fields)
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'])) {
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObject, 'modifyDifferenceArray')) {
-                    $hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $diffUtility);
-                }
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'] ?? [] as $className) {
+            $hookObject = GeneralUtility::makeInstance($className);
+            if (method_exists($hookObject, 'modifyDifferenceArray')) {
+                $hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $diffUtility);
             }
         }
         $commentsForRecord = $this->getCommentsForRecord($parameter->uid, $parameter->table);
index bf1dc45..9d19777 100644 (file)
@@ -605,11 +605,9 @@ class DataHandlerHook
             unset($tempEmailMessage);
             $markers['###SPLITTED_PREVIEW_LINK###'] = $this->workspaceService->generateWorkspaceSplittedPreviewLink($elementUid, true);
             // Hook for preprocessing of the content for formmails:
-            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'])) {
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'] as $className) {
-                    $_procObj = GeneralUtility::makeInstance($className);
-                    $markers = $_procObj->postModifyMarkers($markers, $this);
-                }
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'] ?? [] as $className) {
+                $_procObj = GeneralUtility::makeInstance($className);
+                $markers = $_procObj->postModifyMarkers($markers, $this);
             }
             // send an email to each individual user, to ensure the
             // multilanguage version of the email
index 4824a5f..35e6c5b 100644 (file)
@@ -940,16 +940,13 @@ class WorkspaceService implements SingletonInterface
             }
         }
 
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['hasPageRecordVersions'])
-            && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['hasPageRecordVersions'])) {
-            $parameters = [
-                'workspaceId' => $workspaceId,
-                'pageId' => $pageId,
-                'versionsOnPageCache' => &$this->versionsOnPageCache,
-            ];
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['hasPageRecordVersions'] as $hookFunction) {
-                GeneralUtility::callUserFunction($hookFunction, $parameters, $this);
-            }
+        $parameters = [
+            'workspaceId' => $workspaceId,
+            'pageId' => $pageId,
+            'versionsOnPageCache' => &$this->versionsOnPageCache,
+        ];
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['hasPageRecordVersions'] ?? [] as $hookFunction) {
+            GeneralUtility::callUserFunction($hookFunction, $parameters, $this);
         }
 
         return $this->versionsOnPageCache[$workspaceId][$pageId];
@@ -1080,16 +1077,13 @@ class WorkspaceService implements SingletonInterface
 
             $this->pagesWithVersionsInTable[$workspaceId][$tableName] = $pageIds;
 
-            if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['fetchPagesWithVersionsInTable'])
-                && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['fetchPagesWithVersionsInTable'])) {
-                $parameters = [
-                    'workspaceId' => $workspaceId,
-                    'tableName' => $tableName,
-                    'pagesWithVersionsInTable' => &$this->pagesWithVersionsInTable,
-                ];
-                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['fetchPagesWithVersionsInTable'] as $hookFunction) {
-                    GeneralUtility::callUserFunction($hookFunction, $parameters, $this);
-                }
+            $parameters = [
+                'workspaceId' => $workspaceId,
+                'tableName' => $tableName,
+                'pagesWithVersionsInTable' => &$this->pagesWithVersionsInTable,
+            ];
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService']['fetchPagesWithVersionsInTable'] ?? [] as $hookFunction) {
+                GeneralUtility::callUserFunction($hookFunction, $parameters, $this);
             }
         }
 
index a8cf15a..f1b9819 100644 (file)
@@ -36,7 +36,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms']['version_preview'] = \TYPO3\CMS\Workspaces\Hook\PreviewHook::class . '->overridePermissionCalculation';
 
 // Register workspaces cache if not already done in localconf.php or a previously loaded extension.
-if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache'])) {
+if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache'] ?? false)) {
     $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache'] = [
         'groups' => ['all']
     ];