diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index f48d317bd248dde7c782eaea59273d4480f60c95..1f2aee62ec05a1cb0981368b6bc89e728a36511d 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -240,11 +240,6 @@ parameters: count: 2 path: ../../typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php - - - message: "#^Parameter \\#1 \\$pageId of static method TYPO3\\\\CMS\\\\Backend\\\\Utility\\\\BackendUtility\\:\\:getLabelFromItemListMerged\\(\\) expects int, string given\\.$#" - count: 1 - path: ../../typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php - - message: "#^Property TYPO3\\\\CMS\\\\Belog\\\\Domain\\\\Model\\\\LogEntry\\:\\:\\$newId \\(string\\) does not accept default value of type int\\.$#" count: 1 @@ -300,26 +295,6 @@ parameters: count: 1 path: ../../typo3/sysext/core/Classes/Authentication/IpLocker.php - - - message: "#^Parameter \\#2 \\$default of method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\Mfa\\\\MfaProviderPropertyManager\\:\\:getProperty\\(\\) expects null, array given\\.$#" - count: 4 - path: ../../typo3/sysext/core/Classes/Authentication/Mfa/Provider/RecoveryCodesProvider.php - - - - message: "#^Parameter \\#2 \\$default of method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\Mfa\\\\MfaProviderPropertyManager\\:\\:getProperty\\(\\) expects null, int given\\.$#" - count: 5 - path: ../../typo3/sysext/core/Classes/Authentication/Mfa/Provider/RecoveryCodesProvider.php - - - - message: "#^Parameter \\#2 \\$default of method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\Mfa\\\\MfaProviderPropertyManager\\:\\:getProperty\\(\\) expects null, int given\\.$#" - count: 4 - path: ../../typo3/sysext/core/Classes/Authentication/Mfa/Provider/TotpProvider.php - - - - message: "#^Parameter \\#2 \\$default of method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\Mfa\\\\MfaProviderPropertyManager\\:\\:getProperty\\(\\) expects null, string given\\.$#" - count: 2 - path: ../../typo3/sysext/core/Classes/Authentication/Mfa/Provider/TotpProvider.php - - message: "#^Parameter \\#1 \\$key1 of method Redis\\:\\:sUnion\\(\\) expects string, array\\<int, string\\> given\\.$#" count: 1 @@ -1260,11 +1235,6 @@ parameters: count: 1 path: ../../typo3/sysext/core/Classes/Utility/IpAnonymizationUtility.php - - - message: "#^Parameter \\#2 \\$default of method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\Mfa\\\\MfaProviderPropertyManager\\:\\:getProperty\\(\\) expects null, string given\\.$#" - count: 1 - path: ../../typo3/sysext/core/Tests/Functional/Authentication/Mfa/MfaProviderPropertyManagerTest.php - - message: "#^Parameter \\#2 \\$data of method TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Backend\\\\FileBackend\\:\\:set\\(\\) expects string, array\\<int, string\\> given\\.$#" count: 1 diff --git a/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php b/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php index 2a7f8dd5ea77f6751688877df152369ed5387602..a2ca776742de1cb184f8cbdb02c01749ba50f43d 100644 --- a/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php +++ b/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php @@ -144,7 +144,7 @@ class StandardContentPreviewRenderer implements PreviewRendererInterface, Logger break; case 'list': if (!empty($record['list_type'])) { - $label = BackendUtility::getLabelFromItemListMerged($record['pid'], 'tt_content', 'list_type', $record['list_type']); + $label = BackendUtility::getLabelFromItemListMerged((int)$record['pid'], 'tt_content', 'list_type', $record['list_type']); if (!empty($label)) { $out .= $this->linkEditContent('<strong>' . htmlspecialchars($languageService->sL($label)) . '</strong>', $record); } else { diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php index f3b49d186a4575e4e8c8cb80d9aec9f6328159af..71783f7a66c51c1844dd79d5665356b59f7a3fec 100644 --- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php +++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php @@ -1279,13 +1279,12 @@ class BackendUtility /** * Return the label of a field by additionally checking TsConfig values * - * @param int $pageId Page id * @param string $table Table name * @param string $column Field Name * @param string $key item value * @return string Label for item entry */ - public static function getLabelFromItemListMerged($pageId, $table, $column, $key) + public static function getLabelFromItemListMerged(int $pageId, $table, $column, $key) { $pageTsConfig = static::getPagesTSconfig($pageId); $label = ''; diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php b/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php index 44e12cbde6df46dda79c4fad008d6c2e4a2dda00..c8127d079b826ff1921a82ae1a13d714d5955c05 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php @@ -165,7 +165,7 @@ class GridColumnItem extends AbstractGridObject $contentTypeLabels = $this->context->getContentTypeLabels(); $ctype = $this->record['CType'] ?? ''; return $contentTypeLabels[$ctype] ?? - BackendUtility::getLabelFromItemListMerged($this->record['pid'], 'tt_content', 'CType', $ctype); + BackendUtility::getLabelFromItemListMerged((int)$this->record['pid'], 'tt_content', 'CType', $ctype); } public function getIcons(): string diff --git a/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php b/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php index e9113b00f5384e8edd36d5b813606c5765175567..d83db850783905bab8d73417c92df1b544030048 100644 --- a/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php +++ b/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php @@ -796,7 +796,7 @@ class BackendUtilityTest extends UnitTestCase { return [ 'no field found' => [ - 'pageId' => '123', + 'pageId' => 123, 'table' => 'tt_content', 'col' => 'menu_type', 'key' => '10', @@ -816,7 +816,7 @@ class BackendUtilityTest extends UnitTestCase 'expectedLabel' => '', ], 'no tsconfig set' => [ - 'pageId' => '123', + 'pageId' => 123, 'table' => 'tt_content', 'col' => 'menu_type', 'key' => '1', @@ -843,7 +843,7 @@ class BackendUtilityTest extends UnitTestCase * @dataProvider getLabelFromItemListMergedReturnsCorrectFieldsDataProvider */ public function getLabelFromItemListMergedReturnsCorrectFields( - string $pageId, + int $pageId, string $table, string $column, string $key, diff --git a/typo3/sysext/core/Classes/Authentication/Mfa/MfaProviderPropertyManager.php b/typo3/sysext/core/Classes/Authentication/Mfa/MfaProviderPropertyManager.php index b364d0d77696d613050f87a489012e438b446054..c6e20c8b17a4f44ab8b0784441afee16d4ba0789 100644 --- a/typo3/sysext/core/Classes/Authentication/Mfa/MfaProviderPropertyManager.php +++ b/typo3/sysext/core/Classes/Authentication/Mfa/MfaProviderPropertyManager.php @@ -73,12 +73,8 @@ class MfaProviderPropertyManager implements LoggerAwareInterface /** * Get a provider specific property value or the defined * default value if the requested property was not found. - * - * @param string $key - * @param null $default - * @return mixed|null */ - public function getProperty(string $key, $default = null) + public function getProperty(string $key, mixed $default = null): mixed { return $this->providerProperties[$key] ?? $default; }