Skip to content

Commit

Permalink
Solve PHP 8.4 deprecation (implicit nullable argument type)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 committed Nov 7, 2024
1 parent 3335e68 commit f39d54b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Configuration/CoverageConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

class CoverageConfiguration extends ParallelConfiguration
{
public function __construct(bool $createPublicServiceAliases = false)
public function __construct(?bool $createPublicServiceAliases = false)
{
parent::__construct($createPublicServiceAliases);
parent::__construct($createPublicServiceAliases ?? false);
$this->containerDefinition = new CoverageContainerDefinition();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function filterTestFiles(): array
return $this->filterBySuffix($aggregatedFiles, $this->testSuffix);
}

private function testSuitePassFilter(\DOMElement $testSuiteNode, string $testSuiteFilter = null): bool
private function testSuitePassFilter(\DOMElement $testSuiteNode, ?string $testSuiteFilter = null): bool
{
if ($testSuiteFilter === null) {
return true;
Expand Down Expand Up @@ -161,7 +161,7 @@ private function addFileToAggregateArray(array &$aggregatedFiles, string $fileNa
private function getDOMNodeAttribute(
\DOMElement $testSuiteNode,
string $nodeName,
string $defaultValue = null
?string $defaultValue = null
): string {
/** @psalm-suppress RedundantCondition */
foreach ($testSuiteNode->attributes as $attrName => $attrNode) {
Expand Down
2 changes: 1 addition & 1 deletion src/Logs/ValueObject/TestMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TestMethod extends Test
public function __construct(
public readonly string $className,
public readonly string $methodName,
string $fullName = null,
?string $fullName = null,
) {
parent::__construct($fullName ?? $this->className . '::' . $this->methodName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function createChunkedProcessQueue(): void
}
}

public function pushToPipeline(ProcessTerminated $event = null): void
public function pushToPipeline(?ProcessTerminated $event = null): void
{
if ($event && $this->chunkSize->isChunked()) {
$process = $event->getProcess();
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Logs/EqualsToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EqualsToken implements TokenInterface, \Stringable

private string $string;

public function __construct(private readonly mixed $value, StringUtil $util = null)
public function __construct(private readonly mixed $value, ?StringUtil $util = null)
{
$this->util = $util ?? new StringUtil();
}
Expand Down

0 comments on commit f39d54b

Please sign in to comment.