Skip to content

Commit

Permalink
[TASK] Remove Implicitly nullable parameter declarations deprecated
Browse files Browse the repository at this point in the history
Fixes: #239
Ports: #238
  • Loading branch information
dkd-kaehm committed Dec 17, 2024
1 parent 0e09fe1 commit fc31751
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion Classes/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Report/TikaStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TikaStatus implements StatusProviderInterface
* @throws ExtensionConfigurationPathDoesNotExistException
*/
public function __construct(
array $extensionConfiguration = null,
?array $extensionConfiguration = null,
) {
$this->tikaConfiguration = $extensionConfiguration ?? Util::getTikaExtensionConfiguration();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/Extractor/AbstractExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/File/SizeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/Tika/ServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions Tests/Unit/ExecMockFunctions.php.Hack
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fc31751

Please sign in to comment.