Commit 86330504 authored by crell's avatar crell Committed by Stefan Bürk
Browse files

[BUGFIX] Remove unnecessary else clauses

Resolves: #97742
Releases: main
Change-Id: If4944dd1d45b3e8c9522689f472fec9f6810eacb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74827

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarJoey Bouten <joey.bouten@beech.it>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 1a1a6feb
......@@ -120,11 +120,6 @@ parameters:
count: 1
path: ../../typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
-
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
count: 1
path: ../../typo3/sysext/backend/Classes/Search/LiveSearch/QueryParser.php
-
message: "#^Method TYPO3\\\\CMS\\\\Backend\\\\Search\\\\LiveSearch\\\\QueryParser\\:\\:getId\\(\\) should return int but returns string\\.$#"
count: 1
......@@ -1315,11 +1310,6 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Classes/Tree/TableConfiguration/ArrayTreeRenderer.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php
-
message: "#^Parameter \\#1 \\$id of method TYPO3\\\\CMS\\\\Backend\\\\Tree\\\\TreeNode\\:\\:setId\\(\\) expects string, int given\\.$#"
count: 3
......@@ -1370,11 +1360,6 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Classes/Utility/CommandUtility.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/Utility/CsvUtility.php
-
message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\FrontendInterface\\:\\:require\\(\\)\\.$#"
count: 3
......@@ -2715,11 +2700,6 @@ parameters:
count: 1
path: ../../typo3/sysext/extensionmanager/Classes/Utility/EmConfUtility.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: ../../typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
-
message: "#^Parameter \\#2 \\$selectedStatements of method TYPO3\\\\CMS\\\\Core\\\\Database\\\\Schema\\\\SchemaMigrator\\:\\:migrate\\(\\) expects array\\<string\\>, array\\<int\\|string, true\\> given\\.$#"
count: 1
......
......@@ -130,12 +130,7 @@ class QueryParser
public function getCommandForTable($tableName)
{
$commandArray = array_keys($GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch'], $tableName);
if (is_array($commandArray)) {
$command = $commandArray[0];
} else {
$command = false;
}
return $command;
return $commandArray[0] ?? '';
}
/**
......
......@@ -537,9 +537,7 @@ class DatabaseTreeDataProvider extends AbstractTableConfigurationTreeDataProvide
}
$records = $queryBuilder->executeQuery()->fetchAllAssociative();
$uidArray = is_array($records) ? array_column($records, 'uid') : [];
return $uidArray;
return array_column($records, 'uid');
}
protected function getLanguageService(): ?LanguageService
......
......@@ -60,7 +60,6 @@ class CsvUtility
fwrite($handle, $input);
rewind($handle);
while (($cells = fgetcsv($handle, 0, $fieldDelimiter, $fieldEnclosure)) !== false) {
$cells = is_array($cells) ? $cells : [];
$maximumCellCount = max(count($cells), $maximumCellCount);
$multiArray[] = preg_replace('|<br */?>|i', LF, $cells);
}
......
......@@ -381,7 +381,6 @@ class InstallUtility implements SingletonInterface, LoggerAwareInterface
}
$statements = array_combine(array_keys($updateStatements[$action]), array_fill(0, count($updateStatements[$action]), true));
$statements = is_array($statements) ? $statements : [];
$selectedStatements = array_merge(
$selectedStatements,
$statements
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment