Skip to content

Commit

Permalink
feat: upgrade phpstan to v2 (#15)
Browse files Browse the repository at this point in the history
* feat: upgrade phpstan to v2

* fix: Implicitly marking parameter $var as nullable is deprecated, the explicit nullable type must be used instead

* chore: add missing whitespace
  • Loading branch information
EJTJ3 authored Jan 13, 2025
1 parent 7c7d995 commit 5ba55fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"jms/serializer": "3.28.0",
"symfony/http-client": "6.4.*",
"phpunit/phpunit": "^10.0",
"friendsofphp/php-cs-fixer": "^3.41",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.62",
"phpstan/phpstan": "^2.0",
"phpro/grumphp-shim": "^2.3",
"nyholm/psr7": "^1.8"
},
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
parameters:
level: max
level: max
paths:
- src

2 changes: 1 addition & 1 deletion src/NatsMonitoringClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class NatsMonitoringClient

public function __construct(
private readonly SerializerInterface $serializer,
ClientInterface $client = null,
?ClientInterface $client = null,
private readonly RequestBuilder $requestBuilder = new RequestBuilder(),
) {
$this->client = $client ?? Psr18ClientDiscovery::find();
Expand Down
2 changes: 1 addition & 1 deletion src/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function buildRequest(
string $method,
string $url,
array $query = [],
StreamInterface|string $body = null
StreamInterface|string|null $body = null
): RequestInterface {
if (count($query) !== 0) {
$url .= '?' . http_build_query($query);
Expand Down

0 comments on commit 5ba55fe

Please sign in to comment.