Skip to content

Commit

Permalink
[TASK] Remove Implicitly nullable parameter declarations deprecated
Browse files Browse the repository at this point in the history
Fixes: #237
  • Loading branch information
thomashohn authored and dkd-kaehm committed Dec 17, 2024
1 parent 0f88385 commit d6687e0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 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.2', '8.3' ]
PHP: [ '8.2', '8.3', '8.4' ]
TYPO3: [ '^13.4', '13.4.x-dev' ]
env:
typo3DatabaseName: 'typo3_ci'
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
6 changes: 4 additions & 2 deletions Classes/Service/Extractor/AbstractExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions Classes/Service/File/SizeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

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
4 changes: 2 additions & 2 deletions Tests/Integration/Service/Tika/ServiceIntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
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 d6687e0

Please sign in to comment.