Skip to content

Commit

Permalink
[TASK] Cleanup some more type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
extcode committed Oct 15, 2024
1 parent 3e235e2 commit fb44159
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 41 deletions.
5 changes: 1 addition & 4 deletions Classes/Domain/Model/Cart/BeVariant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions Classes/Event/CheckProductAvailabilityEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 2 additions & 11 deletions Classes/Hooks/ItemsProcFunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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;

Expand Down
13 changes: 2 additions & 11 deletions Classes/Utility/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 1 addition & 6 deletions Classes/ViewHelpers/FieldNameViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit fb44159

Please sign in to comment.