diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ad0d2e3..0169f689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - PHP: [ '8.2', '8.3' ] + PHP: [ '8.2', '8.3', '8.4' ] TYPO3: [ '^13.4', '13.4.x-dev' ] env: typo3DatabaseName: 'typo3_ci' diff --git a/Classes/Report/TikaStatus.php b/Classes/Report/TikaStatus.php index 23411b6a..0f291603 100644 --- a/Classes/Report/TikaStatus.php +++ b/Classes/Report/TikaStatus.php @@ -53,7 +53,7 @@ class TikaStatus implements StatusProviderInterface * @throws ExtensionConfigurationPathDoesNotExistException */ public function __construct( - array $extensionConfiguration = null, + ?array $extensionConfiguration = null, ) { $this->tikaConfiguration = $extensionConfiguration ?? Util::getTikaExtensionConfiguration(); } diff --git a/Classes/Service/Extractor/AbstractExtractor.php b/Classes/Service/Extractor/AbstractExtractor.php index a1b31df1..511afda5 100644 --- a/Classes/Service/Extractor/AbstractExtractor.php +++ b/Classes/Service/Extractor/AbstractExtractor.php @@ -47,8 +47,10 @@ abstract class AbstractExtractor implements ExtractorInterface, LoggerAwareInter * @throws ExtensionConfigurationPathDoesNotExistException * @throws ExtensionConfigurationExtensionNotConfiguredException */ - public function __construct(array $extensionConfiguration = null, SizeValidator $fileSizeValidator = null) - { + public function __construct( + ?array $extensionConfiguration = null, + ?SizeValidator $fileSizeValidator = null, + ) { $this->configuration = $extensionConfiguration ?? Util::getTikaExtensionConfiguration(); $this->fileSizeValidator = $fileSizeValidator ?? GeneralUtility::makeInstance( SizeValidator::class, diff --git a/Classes/Service/File/SizeValidator.php b/Classes/Service/File/SizeValidator.php index 905c7487..ac48e313 100644 --- a/Classes/Service/File/SizeValidator.php +++ b/Classes/Service/File/SizeValidator.php @@ -35,8 +35,9 @@ class SizeValidator * @throws ExtensionConfigurationExtensionNotConfiguredException * @throws ExtensionConfigurationPathDoesNotExistException */ - public function __construct(array $extensionConfiguration = null) - { + public function __construct( + ?array $extensionConfiguration = null, + ) { $this->configuration = $extensionConfiguration ?? Util::getTikaExtensionConfiguration(); } diff --git a/Classes/Service/Tika/ServiceFactory.php b/Classes/Service/Tika/ServiceFactory.php index 8fc4b8f6..b1a56ef6 100644 --- a/Classes/Service/Tika/ServiceFactory.php +++ b/Classes/Service/Tika/ServiceFactory.php @@ -39,7 +39,7 @@ class ServiceFactory */ public static function getTika( string $tikaServiceType, - array $configuration = null, + ?array $configuration = null, ): ServerService|AppService|SolrCellService { if (empty($configuration)) { $configuration = Util::getTikaExtensionConfiguration(); diff --git a/Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php b/Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php index ef3ec587..cefb4f72 100644 --- a/Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php +++ b/Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php @@ -280,8 +280,8 @@ protected function getConfiguration(): array protected function getMockedFileInstance( array $fileData, - ResourceStorage $storage = null, - array $metaData = [] + ?ResourceStorage $storage = null, + array $metaData = [], ): File|MockObject { $fileMock = $this->getMockBuilder(File::class) ->setConstructorArgs([ diff --git a/Tests/Unit/ExecMockFunctions.php.Hack b/Tests/Unit/ExecMockFunctions.php.Hack index 6e46ce8a..647376e7 100644 --- a/Tests/Unit/ExecMockFunctions.php.Hack +++ b/Tests/Unit/ExecMockFunctions.php.Hack @@ -29,8 +29,11 @@ use ApacheSolrForTypo3\Tika\Tests\Unit\ExecRecorder; * exec() mock to capture invocation parameters for the actual \exec() function * @noinspection PhpUnusedParameterInspection */ -function exec(string $command, array &$output = null, int &$result_code = null): string|false -{ +function exec( + string $command, + ?array &$output = null, + ?int &$result_code = null, +): string|false { $output = array_key_exists(ExecRecorder::$execCalled, ExecRecorder::$execOutput) ? ExecRecorder::$execOutput[ExecRecorder::$execCalled] : ''; ExecRecorder::$execCalled++; ExecRecorder::$execCommand = $command;