From fb44159b7d39432e5597ba9d4fed839899f861cf Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Tue, 15 Oct 2024 22:58:59 +0200 Subject: [PATCH] [TASK] Cleanup some more type hints --- Classes/Domain/Model/Cart/BeVariant.php | 5 +---- Classes/Event/CheckProductAvailabilityEvent.php | 3 --- Classes/Hooks/ItemsProcFunc.php | 13 ++----------- Classes/Utility/TemplateLayout.php | 13 ++----------- Classes/ViewHelpers/FieldNameViewHelper.php | 7 +------ .../Form/IsServiceAvailableAtPriceViewHelper.php | 7 +------ 6 files changed, 7 insertions(+), 41 deletions(-) diff --git a/Classes/Domain/Model/Cart/BeVariant.php b/Classes/Domain/Model/Cart/BeVariant.php index 601fd52f..ee1ffbdd 100644 --- a/Classes/Domain/Model/Cart/BeVariant.php +++ b/Classes/Domain/Model/Cart/BeVariant.php @@ -619,10 +619,7 @@ public function getAdditional(string $key) return $this->additional[$key]; } - /** - * @param string $key - */ - public function setAdditional($key, mixed $value): void + public function setAdditional(string $key, mixed $value): void { $this->additional[$key] = $value; } diff --git a/Classes/Event/CheckProductAvailabilityEvent.php b/Classes/Event/CheckProductAvailabilityEvent.php index 28068233..5d23c297 100644 --- a/Classes/Event/CheckProductAvailabilityEvent.php +++ b/Classes/Event/CheckProductAvailabilityEvent.php @@ -77,9 +77,6 @@ public function setMessages(array $messages): void $this->messages = $messages; } - /** - * @param FlashMessage $message - */ public function addMessage(FlashMessage $message): void { $this->messages[] = $message; diff --git a/Classes/Hooks/ItemsProcFunc.php b/Classes/Hooks/ItemsProcFunc.php index 895e9389..49b4a663 100644 --- a/Classes/Hooks/ItemsProcFunc.php +++ b/Classes/Hooks/ItemsProcFunc.php @@ -33,8 +33,6 @@ public function __construct() /** * Itemsproc function to extend the selection of templateLayouts in the plugin - * - * @param array &$config configuration array */ public function user_templateLayout(array &$config): void { @@ -98,12 +96,8 @@ protected function getExtKey($listType) /** * Reduce the template layouts by the ones that are not allowed in given colPos - * - * @param array $templateLayouts - * @param int $currentColPos - * @return array */ - protected function reduceTemplateLayouts($templateLayouts, $currentColPos) + protected function reduceTemplateLayouts(array $templateLayouts, int $currentColPos): array { $currentColPos = (int)$currentColPos; $restrictions = []; @@ -131,11 +125,8 @@ protected function reduceTemplateLayouts($templateLayouts, $currentColPos) /** * Get page id, if negative, then it is a "after record" - * - * @param int $pid - * @return int */ - protected function getPageId($pid) + protected function getPageId(int $pid): int { $pid = (int)$pid; diff --git a/Classes/Utility/TemplateLayout.php b/Classes/Utility/TemplateLayout.php index 7bd41893..549d0b33 100644 --- a/Classes/Utility/TemplateLayout.php +++ b/Classes/Utility/TemplateLayout.php @@ -17,13 +17,8 @@ class TemplateLayout implements SingletonInterface { /** * Get available template layouts for a certain page - * - * @param int $pageUid - * @param string $extKey - * @param string $pluginName - * @return array */ - public function getAvailableTemplateLayouts($pageUid, $extKey, $pluginName) + public function getAvailableTemplateLayouts(int $pageUid, string $extKey, string $pluginName): array { $templateLayouts = []; $pluginName = GeneralUtility::camelCaseToLowerCaseUnderscored($pluginName); @@ -57,12 +52,8 @@ public function getAvailableTemplateLayouts($pageUid, $extKey, $pluginName) /** * Get template layouts defined in TsConfig - * - * @param $pageUid - * @param string $pluginName - * @return array */ - protected function getTemplateLayoutsFromTsConfig($pageUid, $extKey, $pluginName) + protected function getTemplateLayoutsFromTsConfig(int $pageUid, string $extKey, string $pluginName): array { $templateLayouts = []; $pagesTsConfig = BackendUtility::getPagesTSconfig($pageUid); diff --git a/Classes/ViewHelpers/FieldNameViewHelper.php b/Classes/ViewHelpers/FieldNameViewHelper.php index aeb223d1..6e2475bd 100644 --- a/Classes/ViewHelpers/FieldNameViewHelper.php +++ b/Classes/ViewHelpers/FieldNameViewHelper.php @@ -51,12 +51,7 @@ public function render() return $fieldName; } - /** - * @param BeVariant $variant - * - * @return string - */ - protected function getVariantFieldName($variant) + protected function getVariantFieldName(BeVariant $variant): string { $fieldName = ''; diff --git a/Classes/ViewHelpers/Form/IsServiceAvailableAtPriceViewHelper.php b/Classes/ViewHelpers/Form/IsServiceAvailableAtPriceViewHelper.php index 9dab71d4..9d5ca89d 100644 --- a/Classes/ViewHelpers/Form/IsServiceAvailableAtPriceViewHelper.php +++ b/Classes/ViewHelpers/Form/IsServiceAvailableAtPriceViewHelper.php @@ -38,12 +38,7 @@ public function initializeArguments(): void ); } - /** - * @param array|null $arguments - * @return bool - * @api - */ - protected static function evaluateCondition($arguments = null) + protected static function evaluateCondition(array $arguments = null): bool { $service = $arguments['service']; $price = $arguments['price'];