diff --git a/Classes/Controller/AiImageController.php b/Classes/Controller/AiImageController.php index 5b1e693..96465df 100644 --- a/Classes/Controller/AiImageController.php +++ b/Classes/Controller/AiImageController.php @@ -264,7 +264,7 @@ public function upscaleAction(File $file): void $this->redirect('filelist'); } - public function extendAction(string $direction, File $file = null, string $base64 = ''): void + public function extendAction(string $direction, ?File $file = null, string $base64 = ''): void { try { $filePath = ''; diff --git a/Classes/Http/Client/AltTextClient.php b/Classes/Http/Client/AltTextClient.php index 41358e8..5c2774e 100644 --- a/Classes/Http/Client/AltTextClient.php +++ b/Classes/Http/Client/AltTextClient.php @@ -49,7 +49,7 @@ private function getAuthorizationHeader(): array ]; } - public function getAltTextForFile(File $file, string $languageIsoCode = null): string + public function getAltTextForFile(File $file, ?string $languageIsoCode = null): string { $localFile = $file->getOriginalResource()->getForLocalProcessing(); @@ -81,7 +81,7 @@ public function getAltTextForFile(File $file, string $languageIsoCode = null): s return $response->alt_text; } - public function getByAssetId(int $assetId, string $languageIsoCode = null): string + public function getByAssetId(int $assetId, ?string $languageIsoCode = null): string { if (null === $languageIsoCode) { $languageIsoCode = $this->siteLanguageService->getLanguage(); diff --git a/Classes/Service/AiAltTextService.php b/Classes/Service/AiAltTextService.php index b607ed7..4bc33be 100644 --- a/Classes/Service/AiAltTextService.php +++ b/Classes/Service/AiAltTextService.php @@ -32,7 +32,7 @@ public function __construct(AltTextClient $altTextClient) /** * @throws \Exception */ - public function getAltText(File $file, string $languageIsoCode = null): string + public function getAltText(File $file, ?string $languageIsoCode = null): string { try { $altText = $this->altTextClient->getByAssetId($file->getOriginalResource()->getUid(), $languageIsoCode); diff --git a/Classes/Service/ExtendService.php b/Classes/Service/ExtendService.php index c2b46c0..e5441b9 100644 --- a/Classes/Service/ExtendService.php +++ b/Classes/Service/ExtendService.php @@ -81,7 +81,7 @@ public function resolutionForExtendedImage(string $sourceImagePath, string $dire * * @throws \Exception */ - private function getImageDimensions($source = null, string $imagePath = null): array + private function getImageDimensions($source = null, ?string $imagePath = null): array { $width = null; $height = null; diff --git a/Classes/Service/FileService.php b/Classes/Service/FileService.php index 379de25..f4c6e93 100644 --- a/Classes/Service/FileService.php +++ b/Classes/Service/FileService.php @@ -31,7 +31,7 @@ class FileService private string $path = 'mkcontentai'; - public function __construct(string $folder = null) + public function __construct(?string $folder = null) { $this->path = 'mkcontentai/'.$folder; $this->storageRepository = GeneralUtility::makeInstance(StorageRepository::class);