Skip to content

Commit c5c8022

Browse files
committed
Fix implicit nullable parameters deprecation for PHP 8.4
1 parent 72bfe31 commit c5c8022

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Constraint/AbstractCallableThrows.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public function __construct(string $className, $message, $code, bool $exactMatch
8989
protected function fail(
9090
$other,
9191
$description,
92-
ComparisonFailure $comparisonFailure = null,
93-
Throwable $throwable = null
92+
?ComparisonFailure $comparisonFailure = null,
93+
?Throwable $throwable = null
9494
): void {
9595
$failureDescription = sprintf('Failed asserting that %s.', $this->failureDescription($other));
9696

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class TestCase extends \PHPUnit\Framework\TestCase
5454
public function assertCallableThrows(
5555
callable $callable,
5656
string $throwableClassName = Throwable::class,
57-
string $throwableMessage = null
57+
?string $throwableMessage = null
5858
): void {
5959
$throwableFailure = '';
6060
$throwableComparisonFailure = null;
@@ -108,7 +108,7 @@ public function assertCallableThrows(
108108
public function assertCallableThrowsNot(
109109
callable $callable,
110110
string $throwableClassName = Throwable::class,
111-
string $throwableMessage = null
111+
?string $throwableMessage = null
112112
): void {
113113
try {
114114
$callable();

tests/Unit/ThrowableAssertsTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function testCachedCallableProxy(): void
230230
private function mockConstraintInstance(
231231
string $className,
232232
array $constructorArguments = [],
233-
array $evaluateArguments = null
233+
?array $evaluateArguments = null
234234
): MockInterface {
235235
$instanceMock = Mockery::mock('overload:' . $className, Constraint::class);
236236

tests/Utils/InvocableClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class InvocableClass
3838
* @param string|null $throwableClassName the Throwable's class name to thrown when invoked
3939
* @param mixed ...$throwableArguments the arguments to pass to the Throwable
4040
*/
41-
public function __construct(string $throwableClassName = null, ...$throwableArguments)
41+
public function __construct(?string $throwableClassName = null, ...$throwableArguments)
4242
{
4343
$this->throwableClassName = $throwableClassName;
4444
$this->throwableArguments = $throwableArguments;

0 commit comments

Comments
 (0)