diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73f5bc7e..06731cd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - PHP: [ '8.1', '8.2', '8.3' ] + PHP: [ '8.1', '8.2', '8.3', '8.4' ] TYPO3: [ '^12.4', '12.4.x-dev' ] env: TYPO3_DATABASE_NAME: 'typo3_ci' diff --git a/Classes/Process.php b/Classes/Process.php index f167c358..bf0c3922 100644 --- a/Classes/Process.php +++ b/Classes/Process.php @@ -102,7 +102,7 @@ public function findPid(): ?int exec($ps, $output); foreach ($output as $line) { - [$pid, $command] = explode(' ', trim($line ?? ''), 2); + [$pid, $command] = explode(' ', trim($line), 2); $command = $this->escapePsOutputCommand($command); if ($command == $processCommand) { return (int)$pid; 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..263760de 100644 --- a/Classes/Service/Extractor/AbstractExtractor.php +++ b/Classes/Service/Extractor/AbstractExtractor.php @@ -47,7 +47,7 @@ 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( diff --git a/Classes/Service/File/SizeValidator.php b/Classes/Service/File/SizeValidator.php index 905c7487..c765d1dd 100644 --- a/Classes/Service/File/SizeValidator.php +++ b/Classes/Service/File/SizeValidator.php @@ -35,7 +35,7 @@ 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..e7dde301 100644 --- a/Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php +++ b/Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php @@ -280,7 +280,7 @@ protected function getConfiguration(): array protected function getMockedFileInstance( array $fileData, - ResourceStorage $storage = null, + ?ResourceStorage $storage = null, array $metaData = [] ): File|MockObject { $fileMock = $this->getMockBuilder(File::class) 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;