Skip to content

Commit 39d2d1e

Browse files
authored
Merge pull request #526 from wayofdev/feat/ci-fixes
2 parents ab1bc2a + 77cdb0b commit 39d2d1e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Testing/Constraints/CountInDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function failureDescription(mixed $other): string
4747
);
4848
}
4949

50-
public function toString(int $options = 0): string
50+
public function toString(): string
5151
{
5252
return (new ReflectionClass($this))->name;
5353
}

src/Testing/Constraints/HasInDatabase.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use PHPUnit\Framework\Constraint\Constraint;
1212
use Throwable;
1313

14+
use function is_int;
1415
use function json_encode;
1516
use function sprintf;
1617

@@ -56,10 +57,18 @@ public function failureDescription(mixed $other): string
5657
}
5758

5859
/**
60+
* @param mixed|null $options
61+
*
5962
* @throws JsonException
6063
*/
61-
public function toString(int $options = 0): string
64+
public function toString($options = null): string
6265
{
63-
return json_encode($this->data, JSON_THROW_ON_ERROR | $options);
66+
if (is_int($options)) {
67+
$options |= JSON_THROW_ON_ERROR;
68+
} else {
69+
$options = JSON_THROW_ON_ERROR;
70+
}
71+
72+
return json_encode($this->data, $options | $options);
6473
}
6574
}

0 commit comments

Comments
 (0)