Skip to content

Commit 8a4b202

Browse files
committed
Make implicitly nullable types explicit
1 parent 4af2e96 commit 8a4b202

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

tests/bulk/bulkwrite-delete-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable
1313
private $id;
1414
private $child;
1515

16-
public function __construct($id, MyClass $child = null)
16+
public function __construct($id, ?MyClass $child = null)
1717
{
1818
$this->id = $id;
1919
$this->child = $child;

tests/bulk/bulkwrite-insert-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable
1313
private $id;
1414
private $child;
1515

16-
public function __construct($id, MyClass $child = null)
16+
public function __construct($id, ?MyClass $child = null)
1717
{
1818
$this->id = $id;
1919
$this->child = $child;

tests/bulk/bulkwrite-update-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable
1313
private $id;
1414
private $child;
1515

16-
public function __construct($id, MyClass $child = null)
16+
public function __construct($id, ?MyClass $child = null)
1717
{
1818
$this->id = $id;
1919
$this->child = $child;

tests/command/command-ctor-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable
1313
private $id;
1414
private $child;
1515

16-
public function __construct($id, MyClass $child = null)
16+
public function __construct($id, ?MyClass $child = null)
1717
{
1818
$this->id = $id;
1919
$this->child = $child;

tests/query/query-ctor-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable
1313
private $id;
1414
private $child;
1515

16-
public function __construct($id, MyClass $child = null)
16+
public function __construct($id, ?MyClass $child = null)
1717
{
1818
$this->id = $id;
1919
$this->child = $child;

tests/utils/tools.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function get_module_info($row)
9292
return $matches[1];
9393
}
9494

95-
function create_test_manager(string $uri = null, array $options = [], array $driverOptions = [])
95+
function create_test_manager(?string $uri = null, array $options = [], array $driverOptions = [])
9696
{
9797
if (getenv('API_VERSION') && ! isset($driverOptions['serverApi'])) {
9898
$driverOptions['serverApi'] = new ServerApi(getenv('API_VERSION'));
@@ -628,7 +628,7 @@ function severityToString(int $severity): string {
628628
* from a particular function. Returns the message from the raised error or
629629
* exception, or an empty string if neither was thrown.
630630
*/
631-
function raises(callable $callable, int $expectedSeverity, string $expectedFromFunction = null): string
631+
function raises(callable $callable, int $expectedSeverity, ?string $expectedFromFunction = null): string
632632
{
633633
set_error_handler(function(int $severity, string $message, string $file, int $line) {
634634
throw new ErrorException($message, 0, $severity, $file, $line);
@@ -672,7 +672,7 @@ function raises(callable $callable, int $expectedSeverity, string $expectedFromF
672672
* the exception to be thrown from a particular function. Returns the message
673673
* from the thrown exception, or an empty string if one was not thrown.
674674
*/
675-
function throws(callable $callable, string $expectedException, string $expectedFromFunction = null): string
675+
function throws(callable $callable, string $expectedException, ?string $expectedFromFunction = null): string
676676
{
677677
try {
678678
call_user_func($callable);
@@ -730,7 +730,7 @@ function printWriteResult(WriteResult $result, $details = true)
730730
}
731731
}
732732

733-
function printWriteConcernError(WriteConcernError $error = null, $details)
733+
function printWriteConcernError(?WriteConcernError $error = null, $details = null)
734734
{
735735
if ($error) {
736736
/* This stuff is generated by the server, no need for us to test it */

0 commit comments

Comments
 (0)