diff --git a/tests/bulk/bulkwrite-delete-001.phpt b/tests/bulk/bulkwrite-delete-001.phpt index b0bae3521..d8a999b84 100644 --- a/tests/bulk/bulkwrite-delete-001.phpt +++ b/tests/bulk/bulkwrite-delete-001.phpt @@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable private $id; private $child; - public function __construct($id, MyClass $child = null) + public function __construct($id, ?MyClass $child = null) { $this->id = $id; $this->child = $child; diff --git a/tests/bulk/bulkwrite-insert-001.phpt b/tests/bulk/bulkwrite-insert-001.phpt index 4160a95f8..b2e57b11b 100644 --- a/tests/bulk/bulkwrite-insert-001.phpt +++ b/tests/bulk/bulkwrite-insert-001.phpt @@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable private $id; private $child; - public function __construct($id, MyClass $child = null) + public function __construct($id, ?MyClass $child = null) { $this->id = $id; $this->child = $child; diff --git a/tests/bulk/bulkwrite-update-001.phpt b/tests/bulk/bulkwrite-update-001.phpt index a02a78a90..e6e530984 100644 --- a/tests/bulk/bulkwrite-update-001.phpt +++ b/tests/bulk/bulkwrite-update-001.phpt @@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable private $id; private $child; - public function __construct($id, MyClass $child = null) + public function __construct($id, ?MyClass $child = null) { $this->id = $id; $this->child = $child; diff --git a/tests/command/command-ctor-001.phpt b/tests/command/command-ctor-001.phpt index 024b34d96..7716abb52 100644 --- a/tests/command/command-ctor-001.phpt +++ b/tests/command/command-ctor-001.phpt @@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable private $id; private $child; - public function __construct($id, MyClass $child = null) + public function __construct($id, ?MyClass $child = null) { $this->id = $id; $this->child = $child; diff --git a/tests/query/query-ctor-001.phpt b/tests/query/query-ctor-001.phpt index 98861f87c..b2f88a1d4 100644 --- a/tests/query/query-ctor-001.phpt +++ b/tests/query/query-ctor-001.phpt @@ -13,7 +13,7 @@ class MyClass implements MongoDB\BSON\Persistable private $id; private $child; - public function __construct($id, MyClass $child = null) + public function __construct($id, ?MyClass $child = null) { $this->id = $id; $this->child = $child; diff --git a/tests/utils/tools.php b/tests/utils/tools.php index e308e3e5c..07142cc32 100644 --- a/tests/utils/tools.php +++ b/tests/utils/tools.php @@ -92,7 +92,7 @@ function get_module_info($row) return $matches[1]; } -function create_test_manager(string $uri = null, array $options = [], array $driverOptions = []) +function create_test_manager(?string $uri = null, array $options = [], array $driverOptions = []) { if (getenv('API_VERSION') && ! isset($driverOptions['serverApi'])) { $driverOptions['serverApi'] = new ServerApi(getenv('API_VERSION')); @@ -628,7 +628,7 @@ function severityToString(int $severity): string { * from a particular function. Returns the message from the raised error or * exception, or an empty string if neither was thrown. */ -function raises(callable $callable, int $expectedSeverity, string $expectedFromFunction = null): string +function raises(callable $callable, int $expectedSeverity, ?string $expectedFromFunction = null): string { set_error_handler(function(int $severity, string $message, string $file, int $line) { throw new ErrorException($message, 0, $severity, $file, $line); @@ -672,7 +672,7 @@ function raises(callable $callable, int $expectedSeverity, string $expectedFromF * the exception to be thrown from a particular function. Returns the message * from the thrown exception, or an empty string if one was not thrown. */ -function throws(callable $callable, string $expectedException, string $expectedFromFunction = null): string +function throws(callable $callable, string $expectedException, ?string $expectedFromFunction = null): string { try { call_user_func($callable); @@ -730,7 +730,7 @@ function printWriteResult(WriteResult $result, $details = true) } } -function printWriteConcernError(WriteConcernError $error = null, $details) +function printWriteConcernError(?WriteConcernError $error = null, $details = null) { if ($error) { /* This stuff is generated by the server, no need for us to test it */