Skip to content

Commit

Permalink
[BUGFIX] Use more specific type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
thommyhh committed Sep 5, 2024
1 parent 985e159 commit 94ea7ed
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Classes/Controller/SelectImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ protected function getImage(int $id): File
/**
* Get the processed image.
*
* @param File $file The original image file
* @param string[] $params The parameters used to process the image
* @param array $maxDimensions The maximum width and height
* @param File $file The original image file
* @param string[] $params The parameters used to process the image
* @param array<string, int> $maxDimensions The maximum width and height
*
* @return ProcessedFile
*/
Expand Down Expand Up @@ -196,11 +196,16 @@ protected function processImage(File $file, array $params, array $maxDimensions)
);
}

/**
* @param string[] $params
*
* @return int[]|array<string, int>
*/
protected function getMaxDimensions(array $params): array
{
$tsConfig = BackendUtility::getPagesTSconfig($params['pid'] ?? 0);

Check failure on line 206 in Classes/Controller/SelectImageController.php

View workflow job for this annotation

GitHub Actions / Testing PHP 8.1 on ubuntu-24.04

Parameter #1 $pageUid of static method TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig() expects int, int|string given.

Check failure on line 206 in Classes/Controller/SelectImageController.php

View workflow job for this annotation

GitHub Actions / Testing PHP 8.2 on ubuntu-24.04

Parameter #1 $pageUid of static method TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig() expects int, int|string given.

Check failure on line 206 in Classes/Controller/SelectImageController.php

View workflow job for this annotation

GitHub Actions / Testing PHP 8.3 on ubuntu-24.04

Parameter #1 $pageUid of static method TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig() expects int, int|string given.

Check failure on line 206 in Classes/Controller/SelectImageController.php

View workflow job for this annotation

GitHub Actions / Testing PHP 8.1 on ubuntu-24.04

Parameter #1 $pageUid of static method TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig() expects int, int|string given.
$richtextConfigurationName = $params['richtextConfigurationName'] ?? 'default';
if (empty($richtextConfigurationName)) {
if ($richtextConfigurationName === '') {
$richtextConfigurationName = 'default';
}
$rteConfig = $tsConfig['RTE.'][$richtextConfigurationName . '.'];
Expand Down

0 comments on commit 94ea7ed

Please sign in to comment.