Skip to content

Commit 62822ee

Browse files
Merge pull request #1473 from jrfnl/8.x/php-8.4-fix-implicitly-nullable
PHP 8.4 | Fix implicitly nullable parameters (8.x/main)
2 parents ebb2bd7 + 1d12a1e commit 62822ee

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/PhpSpec/Exception/Example/StopOnFailureException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class StopOnFailureException extends ExampleException
2323
public function __construct(
2424
string $message = "",
2525
int $code = 0,
26-
Exception $previous = null,
26+
?Exception $previous = null,
2727
private int $result = 0)
2828
{
2929
parent::__construct($message, $code, $previous);

src/PhpSpec/Matcher/TriggerMatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function negativeMatch(string $name, mixed $subject, array $arguments): D
4444
/**
4545
* @throws \PhpSpec\Exception\Example\FailureException
4646
*/
47-
public function verifyPositive(callable $callable, array $arguments, int $level = null, string $message = null) : void
47+
public function verifyPositive(callable $callable, array $arguments, ?int $level = null, ?string $message = null) : void
4848
{
4949
$triggered = 0;
5050
$prevHandler = function($type, $str, $file, $line, $context=[]){};
@@ -73,7 +73,7 @@ public function verifyPositive(callable $callable, array $arguments, int $level
7373
/**
7474
* @throws \PhpSpec\Exception\Example\FailureException
7575
*/
76-
public function verifyNegative(callable $callable, array $arguments, int $level = null, string $message = null) : void
76+
public function verifyNegative(callable $callable, array $arguments, ?int $level = null, ?string $message = null) : void
7777
{
7878
$triggered = 0;
7979
$prevHandler = function($type, $str, $file, $line, $context=[]){};

src/PhpSpec/Message/CurrentExampleTracker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class CurrentExampleTracker
1717
{
1818
private ?string $currentExample = null;
1919

20-
public function setCurrentExample(string $currentExample = null) : void
20+
public function setCurrentExample(?string $currentExample = null) : void
2121
{
2222
$this->currentExample = $currentExample;
2323
}

src/PhpSpec/Wrapper/Collaborator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function beADoubleOf(string $classOrInterface): void
3333
}
3434
}
3535

36-
public function beConstructedWith(array $arguments = null): void
36+
public function beConstructedWith(?array $arguments = null): void
3737
{
3838
$this->prophecy->willBeConstructedWith($arguments);
3939
}

src/PhpSpec/Wrapper/Subject/Expectation/ConstructorDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(Expectation $expectation)
3030
* @throws \PhpSpec\Exception\Example\ErrorException
3131
* @throws \PhpSpec\Exception\Fracture\FractureException
3232
*/
33-
public function match(string $alias, mixed $subject, array $arguments = [], WrappedObject $wrappedObject = null) : DelayedCall|DuringCall|bool|null
33+
public function match(string $alias, mixed $subject, array $arguments = [], ?WrappedObject $wrappedObject = null) : DelayedCall|DuringCall|bool|null
3434
{
3535
try {
3636
$wrapped = $subject->getWrappedObject();

0 commit comments

Comments
 (0)