[TASK] Clean up unused / dead code 47/58047/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 27 Aug 2018 12:01:21 +0000 (14:01 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 27 Aug 2018 14:36:34 +0000 (16:36 +0200)
A series of unused and dead code places are fixed with the patch:
* Switch + return + break -> the break is obsolete
* A couple of 'too many arguments' when calling methods
* Various assignments of variables that are never used

Change-Id: I8472597f73a739bce053cf6de772c111ae7044d7
Resolves: #85993
Releases: master
Reviewed-on: https://review.typo3.org/58047
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
47 files changed:
typo3/sysext/backend/Classes/Clipboard/Clipboard.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/Page/LocalizationController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlexPrepare.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaRecordTitle.php
typo3/sysext/backend/Classes/Middleware/SiteResolver.php
typo3/sysext/backend/Classes/Module/AbstractFunctionModule.php
typo3/sysext/backend/Classes/Template/Components/Buttons/SplitButton.php
typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/beuser/Classes/Controller/BackendUserController.php
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/core/Classes/Database/SoftReferenceIndex.php
typo3/sysext/core/Classes/Log/LogManager.php
typo3/sysext/core/Classes/Mail/Rfc822AddressesParser.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Classes/Persistence/Generic/Exception/NotImplementedException.php
typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php
typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php
typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/UpdateScriptViewHelper.php
typo3/sysext/feedit/Classes/FrontendEditPanel.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetController.php
typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/impexp/Classes/Utility/ImportExportUtility.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/FileContentParser.php
typo3/sysext/lowlevel/Classes/Command/DeletedRecordsCommand.php
typo3/sysext/lowlevel/Classes/Command/LostFilesCommand.php
typo3/sysext/recycler/Classes/Utility/RecyclerUtility.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
typo3/sysext/workspaces/Classes/Service/StagesService.php

index dbe48ef..07f0edf 100644 (file)
@@ -321,7 +321,7 @@ class Clipboard
 
             // Clear clipboard
             $optionArray[] = [
-                'label' => $languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.clipboard.clear_clipboard', true),
+                'label' => $languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.clipboard.clear_clipboard'),
                 'uri' => $removeAllUrl . '#clip_head'
             ];
             $this->view->assign('optionArray', $optionArray);
index bbbbe09..0125b60 100644 (file)
@@ -1222,7 +1222,6 @@ class EditDocumentController
         $this->errorC = 0;
         $this->newC = 0;
         $editForm = '';
-        $trData = null;
         $beUser = $this->getBackendUser();
         // Traverse the GPvar edit array tables
         foreach ($this->editconf as $table => $conf) {
index 3116f8b..65e8437 100644 (file)
@@ -211,7 +211,7 @@ class LocalizationController
         array $transmittedUidList
     ): array {
         // Get all valid uids that can be processed
-        $validUidList = $result = $this->localizationRepository->getRecordsToCopyDatabaseResult(
+        $validUidList = $this->localizationRepository->getRecordsToCopyDatabaseResult(
             $pageId,
             $destLanguageId,
             $srcLanguageId,
index 2b652bb..6967477 100644 (file)
@@ -1258,7 +1258,6 @@ class PageLayoutController
     {
         if (count($this->MOD_MENU['language']) > 1) {
             $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
-            $lang = $this->getLanguageService();
             $languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
             $languageMenu->setIdentifier('languageMenu');
             foreach ($this->MOD_MENU['language'] as $key => $language) {
index fc72595..d5ca4b9 100644 (file)
@@ -413,10 +413,6 @@ class InputLinkElement extends AbstractFormElement
                         'icon' => $this->iconFactory->getIconForRecord($table, $record, Icon::SIZE_SMALL)->render(),
                     ];
                 } else {
-                    $icon = $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['default'];
-                    if (empty($icon)) {
-                        $icon = 'tcarecords-' . $table . '-default';
-                    }
                     $data = [
                         'text' => sprintf('%s', $linkData['uid']),
                         'icon' => $this->iconFactory->getIcon('tcarecords-' . $table . '-default', Icon::SIZE_SMALL, 'overlay-missing')->render(),
index a90f54f..0d496ac 100644 (file)
@@ -72,7 +72,6 @@ class TcaFlexPrepare implements FormDataProviderInterface
         if (!isset($result['processedTca']['columns'][$fieldName]['config']['dataStructureIdentifier'])) {
             $flexFormTools = GeneralUtility::makeInstance(FlexFormTools::class);
 
-            $dataStructureIdentifier = '';
             $dataStructureArray = ['sheets' => ['sDEF' => []]];
 
             try {
index 2e1874f..29cf7d2 100644 (file)
@@ -164,7 +164,7 @@ class TcaRecordTitle implements FormDataProviderInterface
                 $recordTitle = $this->getRecordTitleForSelectType($rawValue, $fieldConfig);
                 break;
             case 'group':
-                $recordTitle = $this->getRecordTitleForGroupType($rawValue, $fieldConfig);
+                $recordTitle = $this->getRecordTitleForGroupType($rawValue);
                 break;
             case 'check':
                 $recordTitle = $this->getRecordTitleForCheckboxType($rawValue, $fieldConfig);
@@ -251,10 +251,9 @@ class TcaRecordTitle implements FormDataProviderInterface
      * Return the record title for database records
      *
      * @param mixed $value Current database value of this field
-     * @param array $fieldConfig TCA field configuration
      * @return string
      */
-    protected function getRecordTitleForGroupType($value, $fieldConfig)
+    protected function getRecordTitleForGroupType($value)
     {
         $labelParts = [];
         foreach ($value as $singleValue) {
index ada9d7c..0a69484 100644 (file)
@@ -43,7 +43,6 @@ class SiteResolver implements MiddlewareInterface
      */
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
     {
-        $site = null;
         $pageId = (int)($request->getQueryParams()['id'] ?? $request->getParsedBody()['id'] ?? 0);
 
         $rootLine = null;
index 37e4e07..66b5bd7 100644 (file)
@@ -113,11 +113,10 @@ abstract class AbstractFunctionModule
      * Initialize the object
      *
      * @param BaseScriptClass $pObj A reference to the parent (calling) object
-     * @param array $conf The configuration set for this module - from global array TBE_MODULES_EXT
      * @throws \RuntimeException
      * @see \TYPO3\CMS\Backend\Module\BaseScriptClass::checkExtObj()
      */
-    public function init(&$pObj, $conf)
+    public function init($pObj)
     {
         $this->pObj = $pObj;
         // Local lang:
index 28310fd..81d262a 100644 (file)
@@ -76,7 +76,7 @@ class SplitButton extends AbstractButton
      */
     public function addItem(AbstractButton $item, $primaryAction = false)
     {
-        if (!$item->isValid($item)) {
+        if (!$item->isValid()) {
             throw new \InvalidArgumentException(
                 'Only valid items may be assigned to a split Button. "' .
                 $item->getType() .
index cb2a5e1..314b8f0 100644 (file)
@@ -482,11 +482,11 @@ class PagePositionMap
                     // Render header
                     $table .= '<p>';
                     if (isset($columnConfig['colPos']) && $head) {
-                        $table .= '<strong>' . $this->wrapColumnHeader($head, '', '') . '</strong>';
+                        $table .= '<strong>' . $this->wrapColumnHeader($head, '') . '</strong>';
                     } elseif ($columnConfig['colPos']) {
-                        $table .= '<em>' . $this->wrapColumnHeader($this->getLanguageService()->getLL('noAccess'), '', '') . '</em>';
+                        $table .= '<em>' . $this->wrapColumnHeader($this->getLanguageService()->getLL('noAccess'), '') . '</em>';
                     } else {
-                        $table .= '<em>' . $this->wrapColumnHeader(($this->getLanguageService()->sL($columnConfig['name']) ?: '') . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '', '') . '</em>';
+                        $table .= '<em>' . $this->wrapColumnHeader(($this->getLanguageService()->sL($columnConfig['name']) ?: '') . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '') . '</em>';
                     }
                     $table .= '</p>';
                     // Render lines
index aae4213..2302eb7 100644 (file)
@@ -673,10 +673,8 @@ class PageLayoutView implements LoggerAwareInterface
         switch ($table) {
                 case 'pages':
                     return $this->getTable_pages($id);
-                    break;
                 case 'tt_content':
                     return $this->getTable_tt_content($id);
-                    break;
                 default:
                     return '';
             }
index a2edc0d..116bffd 100644 (file)
@@ -163,7 +163,7 @@ class BackendUserController extends BackendUserActionController
         $this->view->assign('timeFormat', $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']);
         $this->view->assign('backendUsers', $this->backendUserRepository->findDemanded($demand));
         $this->view->assign('backendUserGroups', array_merge([''], $this->backendUserGroupRepository->findAll()->toArray()));
-        $this->view->assign('compareUserUidList', array_map(function ($item) {
+        $this->view->assign('compareUserUidList', array_map(function () {
             return true;
         }, array_flip((array)$compareUserList)));
         $this->view->assign('currentUserUid', $this->getBackendUserAuthentication()->user['uid']);
index de25c75..821f7b0 100644 (file)
@@ -209,7 +209,6 @@ abstract class AbstractConditionMatcher
                     }
                 }
                 return false;
-                break;
             case 'language':
                 if (GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE') === $value) {
                     return true;
@@ -227,17 +226,14 @@ abstract class AbstractConditionMatcher
                     }
                 }
                 return false;
-                break;
             case 'IP':
                 if ($value === 'devIP') {
                     $value = trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
                 }
 
                 return (bool)GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value);
-                break;
             case 'hostname':
                 return (bool)GeneralUtility::cmpFQDN(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value);
-                break;
             case 'hour':
             case 'minute':
             case 'month':
@@ -285,10 +281,8 @@ abstract class AbstractConditionMatcher
                     }
                 }
                 return false;
-                break;
             case 'compatVersion':
                 return VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= VersionNumberUtility::convertVersionNumberToInteger($value);
-                break;
             case 'loginUser':
                 if ($this->isUserLoggedIn()) {
                     $values = GeneralUtility::trimExplode(',', $value, true);
@@ -301,7 +295,6 @@ abstract class AbstractConditionMatcher
                     return true;
                 }
                 return false;
-                break;
             case 'page':
                 if ($keyParts[1]) {
                     $page = $this->getPage();
@@ -311,7 +304,6 @@ abstract class AbstractConditionMatcher
                     }
                 }
                 return false;
-                break;
             case 'globalVar':
                 $values = GeneralUtility::trimExplode(',', $value, true);
                 foreach ($values as $test) {
@@ -324,7 +316,6 @@ abstract class AbstractConditionMatcher
                     }
                 }
                 return false;
-                break;
             case 'globalString':
                 $values = GeneralUtility::trimExplode(',', $value, true);
                 foreach ($values as $test) {
@@ -337,7 +328,6 @@ abstract class AbstractConditionMatcher
                     }
                 }
                 return false;
-                break;
             case 'userFunc':
                 $matches = [];
                 preg_match_all('/^\s*([^\(\s]+)\s*(?:\((.*)\))?\s*$/', $value, $matches);
@@ -347,7 +337,6 @@ abstract class AbstractConditionMatcher
                     return true;
                 }
                 return false;
-                break;
         }
         return null;
     }
index cd83337..a0a90fd 100644 (file)
@@ -82,7 +82,7 @@ class Bootstrap
         static::startOutputBuffering();
 
         $configurationManager = static::createConfigurationManager();
-        if (!static::checkIfEssentialConfigurationExists($configurationManager, true)) {
+        if (!static::checkIfEssentialConfigurationExists($configurationManager)) {
             $failsafe = true;
         }
         static::populateLocalConfiguration($configurationManager);
@@ -974,7 +974,6 @@ class Bootstrap
             case 'setFinalCachingFrameworkCacheConfiguration':
             case 'populateLocalConfiguration':
                 return call_user_func_array([self::class, $methodName], $arguments);
-                break;
             default:
                 throw new \Error(sprintf('Call to undefined method "%s"', $methodName), 1534156090);
         }
index b2c177d..beb0829 100644 (file)
@@ -305,14 +305,12 @@ class ExpressionBuilder
                         $this->literal(',')
                     )
                 );
-                break;
             case 'oci8':
             case 'pdo_oracle':
                 throw new \RuntimeException(
                     'FIND_IN_SET support for database platform "Oracle" not yet implemented.',
                     1459696680
                 );
-                break;
             case 'sqlsrv':
             case 'pdo_sqlsrv':
             case 'mssql':
@@ -373,7 +371,6 @@ class ExpressionBuilder
                     )
                 );
                 return $comparison;
-                break;
             default:
                 return sprintf(
                     'FIND_IN_SET(%s, %s)',
index 87d66ac..2a999d3 100644 (file)
@@ -458,7 +458,7 @@ class QueryView
                     } elseif ($mQ === 'count') {
                         $queryBuilder = $connection->createQueryBuilder();
                         $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
-                        $dataRows = $queryBuilder->count('*')
+                        $queryBuilder->count('*')
                             ->from($queryGenerator->table)
                             ->where(QueryHelper::stripLogicalOperatorPrefix($queryString));
                         $fullQueryString = $queryBuilder->getSQL();
@@ -518,7 +518,7 @@ class QueryView
                 if (!empty($rowArr)) {
                     $cPR['header'] = 'Result';
                     $out .= '<table class="table table-striped table-hover">'
-                        . $this->resultRowTitles($dataRow, $GLOBALS['TCA'][$table], $table) . implode(LF, $rowArr)
+                        . $this->resultRowTitles($dataRow, $GLOBALS['TCA'][$table]) . implode(LF, $rowArr)
                         . '</table>';
                 } else {
                     $this->renderNoResultsFoundMessage();
@@ -657,7 +657,7 @@ class QueryView
                     $markup[] = htmlspecialchars($this->languageService->sL($conf['ctrl']['title'])) . ' (' . $count . ')';
                     $markup[] = '  </div>';
                     $markup[] = '  <table class="table table-striped table-hover">';
-                    $markup[] = $this->resultRowTitles($lastRow, $conf, $table);
+                    $markup[] = $this->resultRowTitles($lastRow, $conf);
                     $markup[] = implode(LF, $rowArr);
                     $markup[] = '  </table>';
                     $markup[] = '</div>';
@@ -1158,10 +1158,9 @@ class QueryView
      *
      * @param array $row Table columns
      * @param array $conf Table TCA
-     * @param string $table Table name
      * @return string HTML of table header
      */
-    public function resultRowTitles($row, $conf, $table)
+    public function resultRowTitles($row, $conf)
     {
         $tableHeader = [];
         // Start header row
@@ -1195,10 +1194,10 @@ class QueryView
      *
      * @param array $row
      * @param array $conf
-     * @param mixed $table Not used
      * @return string
+     * @todo Unused?
      */
-    public function csvRowTitles($row, $conf, $table)
+    public function csvRowTitles($row, $conf)
     {
         $out = '';
         foreach ($row as $fieldName => $fieldValue) {
index 7478ba7..c138760 100644 (file)
@@ -124,16 +124,16 @@ class SoftReferenceIndex
                 $retVal = $resultArray;
                 break;
             case 'images':
-                $retVal = $this->findRef_images($content, $spParams);
+                $retVal = $this->findRef_images($content);
                 break;
             case 'typolink':
                 $retVal = $this->findRef_typolink($content, $spParams);
                 break;
             case 'typolink_tag':
-                $retVal = $this->findRef_typolink_tag($content, $spParams);
+                $retVal = $this->findRef_typolink_tag($content);
                 break;
             case 'ext_fileref':
-                $retVal = $this->findRef_extension_fileref($content, $spParams);
+                $retVal = $this->findRef_extension_fileref($content);
                 break;
             case 'email':
                 $retVal = $this->findRef_email($content, $spParams);
@@ -154,10 +154,9 @@ class SoftReferenceIndex
      * Any "clear.gif" images are ignored.
      *
      * @param string $content The input content to analyse
-     * @param array $spParams Parameters set for the softref parser key in TCA/columns
      * @return array Result array on positive matches, see description above. Otherwise FALSE
      */
-    public function findRef_images($content, $spParams)
+    public function findRef_images($content)
     {
         // Start HTML parser and split content by image tag:
         $htmlParser = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\HtmlParser::class);
@@ -252,11 +251,10 @@ class SoftReferenceIndex
      * Will search for <link ...> and <a> tags in the content string and process any found.
      *
      * @param string $content The input content to analyse
-     * @param array $spParams Parameters set for the softref parser key in TCA/columns
      * @return array Result array on positive matches, see description above. Otherwise FALSE
      * @see \TYPO3\CMS\Frontend\ContentObject::typolink(), getTypoLinkParts()
      */
-    public function findRef_typolink_tag($content, $spParams)
+    public function findRef_typolink_tag($content)
     {
         // Parse string for special TYPO3 <link> tag:
         $htmlParser = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\HtmlParser::class);
@@ -396,10 +394,9 @@ class SoftReferenceIndex
      * Finding reference to files from extensions in content, but only to notify about their existence. No substitution
      *
      * @param string $content The input content to analyse
-     * @param array $spParams Parameters set for the softref parser key in TCA/columns
      * @return array Result array on positive matches, see description above. Otherwise FALSE
      */
-    public function findRef_extension_fileref($content, $spParams)
+    public function findRef_extension_fileref($content)
     {
         // Files starting with EXT:
         $parts = preg_split('/([^[:alnum:]"\']+)(EXT:[[:alnum:]_]+\\/[^[:space:]"\',]*)/', ' ' . $content . ' ', 10000, PREG_SPLIT_DELIM_CAPTURE);
index eb0605b..a2508a0 100644 (file)
@@ -136,9 +136,8 @@ class LogManager implements SingletonInterface, LogManagerInterface
         $configuration = $this->getConfigurationForLogger(self::CONFIGURATION_TYPE_WRITER, $logger->getName());
         foreach ($configuration as $severityLevel => $writer) {
             foreach ($writer as $logWriterClassName => $logWriterOptions) {
-                /** @var $logWriter \TYPO3\CMS\Core\Log\Writer\WriterInterface */
-                $logWriter = null;
                 try {
+                    /** @var $logWriter \TYPO3\CMS\Core\Log\Writer\WriterInterface */
                     $logWriter = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($logWriterClassName, $logWriterOptions);
                     $logger->addWriter($severityLevel, $logWriter);
                 } catch (\Psr\Log\InvalidArgumentException $e) {
@@ -160,9 +159,8 @@ class LogManager implements SingletonInterface, LogManagerInterface
         $configuration = $this->getConfigurationForLogger(self::CONFIGURATION_TYPE_PROCESSOR, $logger->getName());
         foreach ($configuration as $severityLevel => $processor) {
             foreach ($processor as $logProcessorClassName => $logProcessorOptions) {
-                /** @var $logProcessor \TYPO3\CMS\Core\Log\Processor\ProcessorInterface */
-                $logProcessor = null;
                 try {
+                    /** @var $logProcessor \TYPO3\CMS\Core\Log\Processor\ProcessorInterface */
                     $logProcessor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($logProcessorClassName, $logProcessorOptions);
                     $logger->addProcessor($severityLevel, $logProcessor);
                 } catch (\Psr\Log\InvalidArgumentException $e) {
index 80bae80..95afcd0 100644 (file)
@@ -551,7 +551,6 @@ class Rfc822AddressesParser
     {
         // A couple of defaults.
         $phrase = '';
-        $comment = '';
         $comments = [];
         // Catch any RFC822 comments and store them separately.
         $_mailbox = $mailbox;
index 0acbc24..072d7fe 100644 (file)
@@ -741,7 +741,7 @@ class TemplateService
 
         // Process extension static files if not done yet, but explicitly requested
         if (!$this->extensionStaticsProcessed && $this->processExtensionStatics) {
-            $this->addExtensionStatics('sys_0', 'sys_0', 0, []);
+            $this->addExtensionStatics('sys_0', 'sys_0', 0);
         }
 
         // Add the global default TypoScript from the TYPO3_CONF_VARS
@@ -932,7 +932,7 @@ class TemplateService
         // If "Include before all static templates if root-flag is set" is set:
         $staticFileMode = $row['static_file_mode'] ?? null;
         if ($staticFileMode == 3 && strpos($templateID, 'sys_') === 0 && $row['root']) {
-            $this->addExtensionStatics($idList, $templateID, $pid, $row);
+            $this->addExtensionStatics($idList, $templateID, $pid);
         }
         // Static Template Files (Text files from extensions): include_static_file is a list of static files to include (from extensions)
         if (trim($row['include_static_file'] ?? '')) {
@@ -964,7 +964,7 @@ class TemplateService
         // If "Default (include before if root flag is set)" is set OR
         // "Always include before this template record" AND root-flag are set
         if ($staticFileMode == 1 || $staticFileMode == 0 && substr($templateID, 0, 4) === 'sys_' && $row['root']) {
-            $this->addExtensionStatics($idList, $templateID, $pid, $row);
+            $this->addExtensionStatics($idList, $templateID, $pid);
         }
         // Include Static Template Records after all other TypoScript has been included.
         $_params = [
@@ -1004,11 +1004,10 @@ class TemplateService
      * @param string $idList A list of already processed template ids including the current; The list is on the form "[prefix]_[uid]" where [prefix] is "sys" for "sys_template" records and "ext_" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.
      * @param string $templateID The id of the current template. Same syntax as $idList ids, eg. "sys_123
      * @param int $pid The PID of the input template record
-     * @param array $row A full TypoScript template record
      * @access private
      * @see includeStaticTypoScriptSources()
      */
-    public function addExtensionStatics($idList, $templateID, $pid, $row)
+    public function addExtensionStatics($idList, $templateID, $pid)
     {
         $this->extensionStaticsProcessed = true;
 
index 8f5432d..e814239 100644 (file)
@@ -898,7 +898,6 @@ class ExtendedFileUtility extends BasicFileUtility
             $this->addMessageToFlashMessageQueue('FileUtility.DestinationWasNotADirectory', [$cmds['target']]);
             return false;
         }
-        $resultObject = null;
         $folderName = $cmds['data'];
         try {
             $resultObject = $targetFolderObject->createFolder($folderName);
index af2dd46..f3f6035 100644 (file)
@@ -352,10 +352,10 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
             if ($object->_isNew()) {
                 $this->insertObject($object);
             }
-            $this->persistObject($object, null);
+            $this->persistObject($object);
         }
         foreach ($this->changedEntities as $object) {
-            $this->persistObject($object, null);
+            $this->persistObject($object);
         }
     }
 
index 8b7ee71..fef60b2 100644 (file)
@@ -21,9 +21,10 @@ class NotImplementedException extends \TYPO3\CMS\Extbase\Persistence\Exception
 {
     /**
      * @param string $method
+     * @param int $exceptionCode
      */
-    public function __construct($method)
+    public function __construct($method, int $exceptionCode = null)
     {
-        parent::__construct(sprintf('Method %s is not supported by generic persistence"', $method), 1350213237);
+        parent::__construct(sprintf('Method %s is not supported by generic persistence"', $method), $exceptionCode ?? 1350213237);
     }
 }
index 1eba811..102eedb 100644 (file)
@@ -81,7 +81,7 @@ class LazyLoadingProxy implements \Iterator, \TYPO3\CMS\Extbase\Persistence\Gene
         // usually that does not happen, but if the proxy is held from outside
         // its parent ... the result would be weird.
         if ($this->parentObject->_getProperty($this->propertyName) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
-            $objects = $this->dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue, false, false);
+            $objects = $this->dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue, false);
             $propertyValue = $this->dataMapper->mapResultToPropertyValue($this->parentObject, $this->propertyName, $objects);
             $this->parentObject->_setProperty($this->propertyName, $propertyValue);
             $this->parentObject->_memorizeCleanState($this->propertyName);
index 56ad15b..78fb142 100644 (file)
@@ -638,7 +638,6 @@ class Query implements QueryInterface
      *
      * @param string $propertyName The name of the multivalued property to compare against
      * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException
-     * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException if used on a single-valued property
      * @return bool
      * @api
      */
index 7fa873f..cfe449a 100644 (file)
@@ -1020,7 +1020,7 @@ class Typo3DbQueryParser
             $this->suggestDistinctQuery = true;
         } elseif ($columnMap->getTypeOfRelation() === ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
             $relationTableName = $columnMap->getRelationTableName();
-            $relationTableAlias = $relationTableAlias = $this->getUniqueAlias($relationTableName, $fullPropertyPath . '_mm');
+            $relationTableAlias = $this->getUniqueAlias($relationTableName, $fullPropertyPath . '_mm');
 
             $joinConditionExpression = $this->queryBuilder->expr()->andX(
                 $this->queryBuilder->expr()->eq(
index 23006d7..7cc46df 100644 (file)
@@ -312,10 +312,9 @@ class ObjectStorage implements \Countable, \Iterator, \ArrayAccess, ObjectMonito
     /**
      * Dummy method to avoid unserialization.
      *
-     * @param string $serialized
      * @throws \RuntimeException
      */
-    public function unserialize($serialized)
+    public function unserialize()
     {
         throw new \RuntimeException('A ObjectStorage instance cannot be unserialized.', 1267700870);
     }
index af10386..014639e 100644 (file)
@@ -54,7 +54,6 @@ class UpdateScriptViewHelper extends ActionViewHelper
     public function render()
     {
         $extensionKey = $this->arguments['extensionKey'];
-        $tag = '';
 
         // If the "class.ext_update.php" file exists, build link to the update script screen
         /** @var $updateScriptUtility \TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility */
index 921a72d..1fb3532 100644 (file)
@@ -86,7 +86,7 @@ class FrontendEditPanel
      */
     public function editPanel($content, array $conf, $currentRecord = '', array $dataArr = [], $table = '', array $allow = [], $newUID = 0, array $hiddenFields = [])
     {
-        $hiddenFieldString = $command = '';
+        $hiddenFieldString = '';
 
         // Special content is about to be shown, so the cache must be disabled.
         $this->frontendController->set_no_cache('Frontend edit panel is shown', true);
index 6d1e9f2..a39ff2f 100644 (file)
@@ -1316,7 +1316,6 @@ class FileList
         $cells = [];
         $fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
         $md5 = GeneralUtility::shortMD5($fullIdentifier);
-        $isSel = $this->clipObj->isSelected('_FILE', $md5);
         /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
         $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
 
index 0dd9d11..3de5a80 100644 (file)
@@ -62,7 +62,6 @@ abstract class AbstractWidgetController extends \TYPO3\CMS\Extbase\Mvc\Controlle
         $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
         $widgetViewHelperClassName = $this->request->getWidgetContext()->getWidgetViewHelperClassName();
         $templatePaths = new TemplatePaths($this->controllerContext->getRequest()->getControllerExtensionKey());
-        $widgetViewConfiguration = null;
         $parentConfiguration = $view->getTemplatePaths()->toArray();
         $rootConfiguration = $templatePaths->toArray();
         $pluginConfiguration = $extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName] ?? [];
index 08e9caf..89f07db 100644 (file)
@@ -449,7 +449,6 @@ class FrontendUserAuthentication extends AbstractUserAuthentication
      */
     protected function performLogoff()
     {
-        $oldSession = [];
         $sessionData = [];
         try {
             // Session might not be loaded at this point, so fetch it
index 766fca4..be6346c 100644 (file)
@@ -4761,8 +4761,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
      */
     protected function getCropAreaFromFileReference(FileReference $fileReference, array $fileArray)
     {
-        /** @var Area $cropArea */
-        $cropArea = null;
         // Use cropping area from file reference if nothing is configured in TypoScript.
         if (!isset($fileArray['crop']) && !isset($fileArray['crop.'])) {
             // Set crop variant from TypoScript settings. If not set, use default.
@@ -5484,10 +5482,8 @@ class ContentObjectRenderer implements LoggerAwareInterface
             switch ($conf['returnLast']) {
                 case 'url':
                     return $this->lastTypoLinkUrl;
-                    break;
                 case 'target':
                     return $this->lastTypoLinkTarget;
-                    break;
             }
         }
 
index e6ed34e..d1897c1 100644 (file)
@@ -4980,7 +4980,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             case 'sys_language_contentOL':
                 trigger_error('Property $TSFE->sys_language_contentOL is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
                 return $this->context->getPropertyFromAspect('language', 'legacyOverlayType', '0');
-                break;
             case 'sys_language_mode':
                 trigger_error('Property $TSFE->sys_language_mode is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
                 return $this->context->getPropertyFromAspect('language', 'legacyLanguageMode', '');
index ce8fc01..fc93930 100644 (file)
@@ -253,7 +253,7 @@ class GifBuilder extends GraphicalFunctions
             $this->setup['workArea'] = $this->calcOffset($this->setup['workArea']);
             foreach ($sKeyArray as $theKey) {
                 $theValue = $this->setup[$theKey];
-                if ((int)$theKey && ($conf = $this->setup[$theKey . '.'])) {
+                if ((int)$theKey && $this->setup[$theKey . '.']) {
                     switch ($theValue) {
                         case 'TEXT':
 
@@ -722,16 +722,12 @@ class GifBuilder extends GraphicalFunctions
     {
         switch (strtolower($this->setup['format'])) {
             case 'jpg':
-
             case 'jpeg':
                 return 'jpg';
-                break;
             case 'png':
                 return 'png';
-                break;
             case 'gif':
                 return 'gif';
-                break;
             default:
                 return $this->gifExtension;
         }
index 63726b2..69f92de 100644 (file)
@@ -540,7 +540,6 @@ class PageRepository implements LoggerAwareInterface
             trigger_error('Calling getPagesOverlay() with "-1" as languageId is discouraged and will be unsupported in TYPO3 v10.0. Omit the parameter or use "null" instead.', E_USER_DEPRECATED);
             $languageUid = $this->sys_language_uid;
         }
-        $row = null;
         foreach ($pagesInput as &$origPage) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] ?? [] as $className) {
                 $hookObject = GeneralUtility::makeInstance($className);
index e455308..f4928fe 100644 (file)
@@ -44,7 +44,7 @@ class ImportExportUtility
         }
         /** @var $import Import */
         $import = GeneralUtility::makeInstance(Import::class);
-        $import->init(0, 'import');
+        $import->init();
 
         $this->emitAfterImportExportInitialisationSignal($import);
 
index b22a4c5..215860c 100644 (file)
@@ -607,10 +607,8 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
         switch ((string)$this->searchData['sortOrder']) {
             case 'rank_count':
                 return $row['order_val'] . ' ' . LocalizationUtility::translate('result.ratingMatches', 'IndexedSearch');
-                break;
             case 'rank_first':
                 return ceil(MathUtility::forceIntegerInRange(255 - $row['order_val'], 1, 255) / 255 * 100) . '%';
-                break;
             case 'rank_flag':
                 if ($this->firstRow['order_val2']) {
                     // (3 MSB bit, 224 is highest value of order_val1 currently)
@@ -625,13 +623,10 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                 $max = 10000;
                 $total = MathUtility::forceIntegerInRange($row['order_val'], 0, $max);
                 return ceil(log($total) / log($max) * 100) . '%';
-                break;
             case 'crdate':
                 return $GLOBALS['TSFE']->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_crdate'], 0);
-                break;
             case 'mtime':
                 return $GLOBALS['TSFE']->cObj->calcAge($GLOBALS['EXEC_TIME'] - $row['item_mtime'], 0);
-                break;
             default:
                 return ' ';
         }
index 187f02c..22dc3b8 100644 (file)
@@ -282,7 +282,6 @@ class FileContentParser
             case 'tif':
                 // TIF images (EXIF comment)
                 return true;
-                break;
         }
         return false;
     }
@@ -398,24 +397,19 @@ class FileContentParser
             case 'tif':
                 // PHP EXIF
                 return sprintf($this->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:extension.Images'), $extension);
-                break;
             case 'html':
             case 'htm':
                 // PHP strip-tags()
                 return sprintf($this->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:extension.HTML'), $extension);
-                break;
             case 'txt':
                 // Raw text
                 return sprintf($this->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:extension.TXT'), $extension);
-                break;
             case 'csv':
                 // Raw text
                 return sprintf($this->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:extension.CSV'), $extension);
-                break;
             case 'xml':
                 // PHP strip-tags()
                 return sprintf($this->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang_main.xlf:extension.XML'), $extension);
-                break;
             default:
                 // Do nothing
         }
@@ -434,7 +428,6 @@ class FileContentParser
         switch ((string)$extension) {
             case 'pdf':
                 return true;
-                break;
         }
         return false;
     }
index 3b6ffcc..1bddbee 100644 (file)
@@ -137,7 +137,7 @@ class DeletedRecordsCommand extends Command
 
         $pageId = (int)$pageId;
         if ($pageId > 0) {
-            $pageRecordIsDeleted = $queryBuilderForPages
+            $queryBuilderForPages
                 ->select('uid', 'deleted')
                 ->from('pages')
                 ->where(
index efb3b03..b461316 100644 (file)
@@ -222,7 +222,7 @@ If you want to get more detailed information, use the --verbose option.')
             }
 
             // Looking for a reference from a field which is NOT a soft reference (thus, only fields with a proper TCA/Flexform configuration)
-            $result = $queryBuilder
+            $queryBuilder
                 ->select('hash')
                 ->from('sys_refindex')
                 ->where(
index 1fe5231..c90eee3 100644 (file)
@@ -82,7 +82,7 @@ class RecyclerUtility
     public static function getRecordPath($uid)
     {
         $uid = (int)$uid;
-        $output = ($fullOutput = '/');
+        $output = '/';
         if ($uid === 0) {
             return $output;
         }
index bac3f2e..238550e 100644 (file)
@@ -1080,7 +1080,6 @@ class SetupModuleController
 
         // If password is updated, output whether it failed or was OK.
         if ($this->passwordIsSubmitted) {
-            $flashMessage = null;
             switch ($this->passwordIsUpdated) {
                 case self::PASSWORD_OLD_WRONG:
                     $flashMessages[] = $this->getFlashMessage('oldPassword_failed', 'newPassword', FlashMessage::ERROR);
index 01496bb..5a6fd8f 100644 (file)
@@ -51,11 +51,9 @@ class TemplateAnalyzerModuleFunctionController extends AbstractFunctionModule
      * Init
      *
      * @param TypoScriptTemplateModuleController $pObj
-     * @param array $conf
      */
-    public function init(&$pObj, $conf)
+    public function init($pObj)
     {
-        parent::init($pObj, $conf);
         $this->localLanguageFilePath = 'EXT:tstemplate/Resources/Private/Language/locallang_analyzer.xlf';
         $this->pObj->modMenu_setDefaultList .= ',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax';
     }
index 0591021..3174a08 100644 (file)
@@ -55,11 +55,10 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
      * Init
      *
      * @param TypoScriptTemplateModuleController $pObj
-     * @param array $conf
      */
-    public function init(&$pObj, $conf)
+    public function init($pObj)
     {
-        parent::init($pObj, $conf);
+        parent::init($pObj);
         $this->pObj->modMenu_dontValidateList .= ',ts_browser_toplevel_setup,ts_browser_toplevel_const,ts_browser_TLKeys_setup,ts_browser_TLKeys_const';
         $this->pObj->modMenu_setDefaultList .= ',ts_browser_fixedLgd,ts_browser_showComments';
         $this->localLanguageFilePath = 'EXT:tstemplate/Resources/Private/Language/locallang_objbrowser.xlf';
index 59202a0..d2a7217 100644 (file)
@@ -318,7 +318,7 @@ class StagesService implements SingletonInterface
         $workspaceStageRecs = $this->getStagesForWS();
         if (is_array($workspaceStageRecs) && !empty($workspaceStageRecs)) {
             reset($workspaceStageRecs);
-            while ($workspaceStageRecKey = key($workspaceStageRecs) !== null) {
+            while (key($workspaceStageRecs) !== null) {
                 $workspaceStageRec = current($workspaceStageRecs);
                 if ($workspaceStageRec['uid'] == $stageId) {
                     $nextStage = next($workspaceStageRecs);
@@ -385,7 +385,7 @@ class StagesService implements SingletonInterface
         $workspaceStageRecs = $this->getStagesForWS();
         if (is_array($workspaceStageRecs) && !empty($workspaceStageRecs)) {
             end($workspaceStageRecs);
-            while ($workspaceStageRecKey = key($workspaceStageRecs) !== null) {
+            while (key($workspaceStageRecs) !== null) {
                 $workspaceStageRec = current($workspaceStageRecs);
                 if ($workspaceStageRec['uid'] == $stageId) {
                     $prevStage = prev($workspaceStageRecs);