From b9f89261fe2a9436c312bd311a8e74ee4bfe6b27 Mon Sep 17 00:00:00 2001 From: Chris Lloyd Date: Mon, 2 Dec 2024 11:33:42 +0000 Subject: [PATCH] WIP --- src/Attributes/LodataNamespace.php | 2 +- src/Controller/Response.php | 2 +- src/Exception/Internal/ParserException.php | 2 +- src/Exception/Protocol/ProtocolException.php | 2 +- src/Transaction/ParameterList.php | 2 +- tests/Helpers/MockPredisConnection.php | 2 +- tests/Helpers/StreamingJsonMatches.php | 2 +- .../StreamingJsonMatches/StreamingJsonMatches81.php | 2 +- tests/Helpers/UseDatabaseAssertions.php | 8 ++++---- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Attributes/LodataNamespace.php b/src/Attributes/LodataNamespace.php index 57b2e592b..806d3ddc4 100644 --- a/src/Attributes/LodataNamespace.php +++ b/src/Attributes/LodataNamespace.php @@ -11,7 +11,7 @@ class LodataNamespace { protected ?string $name = null; - public function __construct(string $name = null) + public function __construct(?string $name = null) { $this->name = $name; } diff --git a/src/Controller/Response.php b/src/Controller/Response.php index 629a78cd0..ba848adb2 100644 --- a/src/Controller/Response.php +++ b/src/Controller/Response.php @@ -39,7 +39,7 @@ abstract class Response extends StreamedResponse */ public $exception; - public function __construct(callable $callback = null, int $status = 200, array $headers = []) + public function __construct(?callable $callback = null, int $status = 200, array $headers = []) { parent::__construct($callback, $status, $headers); diff --git a/src/Exception/Internal/ParserException.php b/src/Exception/Internal/ParserException.php index 15dbc3c82..f7a4c3cb5 100644 --- a/src/Exception/Internal/ParserException.php +++ b/src/Exception/Internal/ParserException.php @@ -13,7 +13,7 @@ */ final class ParserException extends BadRequestException { - public function __construct(string $message, Lexer $lexer = null) + public function __construct(string $message, ?Lexer $lexer = null) { if ($lexer) { $message .= ' at: '.$lexer->errorContext(); diff --git a/src/Exception/Protocol/ProtocolException.php b/src/Exception/Protocol/ProtocolException.php index 3c2a530d0..908265ca3 100644 --- a/src/Exception/Protocol/ProtocolException.php +++ b/src/Exception/Protocol/ProtocolException.php @@ -30,7 +30,7 @@ abstract class ProtocolException extends RuntimeException implements Responsable protected $suppressContent = false; protected $originalException = null; - public function __construct(string $code = null, string $message = null, Throwable $originalException = null) + public function __construct(?string $code = null, ?string $message = null, ?Throwable $originalException = null) { if ($code) { $this->odataCode = $code; diff --git a/src/Transaction/ParameterList.php b/src/Transaction/ParameterList.php index 14c79ac7a..07ccc3e8c 100644 --- a/src/Transaction/ParameterList.php +++ b/src/Transaction/ParameterList.php @@ -27,7 +27,7 @@ public function __construct() * Parse a string into separate parameters * @param string|null $text */ - public function parse(string $text = null) + public function parse(?string $text = null) { if (!$text) { return; diff --git a/tests/Helpers/MockPredisConnection.php b/tests/Helpers/MockPredisConnection.php index 1f969dd28..8e9df261c 100644 --- a/tests/Helpers/MockPredisConnection.php +++ b/tests/Helpers/MockPredisConnection.php @@ -11,7 +11,7 @@ class MockPredisConnection extends PredisConnection { - public function pipeline(callable $callback = null) + public function pipeline(?callable $callback = null) { $pipeline = $this->client()->pipeline(); diff --git a/tests/Helpers/StreamingJsonMatches.php b/tests/Helpers/StreamingJsonMatches.php index c7bf14338..26c947920 100644 --- a/tests/Helpers/StreamingJsonMatches.php +++ b/tests/Helpers/StreamingJsonMatches.php @@ -33,7 +33,7 @@ protected function recode(string $string): string return json_encode(json_decode($string)); } - protected function _fail($other, string $description, ComparisonFailure $comparisonFailure = null): void + protected function _fail($other, string $description, ?ComparisonFailure $comparisonFailure = null): void { if ($comparisonFailure === null) { $decodedOther = json_decode($other); diff --git a/tests/Helpers/StreamingJsonMatches/StreamingJsonMatches81.php b/tests/Helpers/StreamingJsonMatches/StreamingJsonMatches81.php index 10a606038..3f8f1d09d 100644 --- a/tests/Helpers/StreamingJsonMatches/StreamingJsonMatches81.php +++ b/tests/Helpers/StreamingJsonMatches/StreamingJsonMatches81.php @@ -10,7 +10,7 @@ class StreamingJsonMatches81 extends StreamingJsonMatches { - public function fail($other, string $description, ComparisonFailure $comparisonFailure = null): never + public function fail($other, string $description, ?ComparisonFailure $comparisonFailure = null): never { $this->_fail($other, $description, $comparisonFailure); diff --git a/tests/Helpers/UseDatabaseAssertions.php b/tests/Helpers/UseDatabaseAssertions.php index 9a81dedf7..ce190afde 100644 --- a/tests/Helpers/UseDatabaseAssertions.php +++ b/tests/Helpers/UseDatabaseAssertions.php @@ -82,7 +82,7 @@ protected function assertNoTransactionsInProgress() // https://github.com/mattiasgeniar/phpunit-query-count-assertions/blob/master/src/AssertsQueryCounts.php - protected function assertNoQueriesExecuted(Closure $closure = null): void + protected function assertNoQueriesExecuted(?Closure $closure = null): void { if ($closure) { self::trackQueries(); @@ -97,7 +97,7 @@ protected function assertNoQueriesExecuted(Closure $closure = null): void } } - protected function assertQueryCountMatches(int $count, Closure $closure = null): void + protected function assertQueryCountMatches(int $count, ?Closure $closure = null): void { if ($closure) { self::trackQueries(); @@ -112,7 +112,7 @@ protected function assertQueryCountMatches(int $count, Closure $closure = null): } } - protected function assertQueryCountLessThan(int $count, Closure $closure = null): void + protected function assertQueryCountLessThan(int $count, ?Closure $closure = null): void { if ($closure) { self::trackQueries(); @@ -127,7 +127,7 @@ protected function assertQueryCountLessThan(int $count, Closure $closure = null) } } - protected function assertQueryCountGreaterThan(int $count, Closure $closure = null): void + protected function assertQueryCountGreaterThan(int $count, ?Closure $closure = null): void { if ($closure) { self::trackQueries();