Skip to content

Commit 350e120

Browse files
committed
PHPStan level 8
1 parent 657d5d5 commit 350e120

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 7
2+
level: 8
33
paths:
44
- ai-command.php
55
- src/

src/AI/AiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* AI client class.
2222
*
23-
* @phpstan-type ToolDefinition array{name: string, description: string, parameters: array<string, array<string, mixed>>, server: string, callback: callable}
23+
* @phpstan-type ToolDefinition array{name: string, description: string|null, parameters: array<string, array<string, mixed>>, server: string, callback: callable}
2424
*/
2525
class AiClient {
2626
private bool $needs_approval = true;

src/MCP/HttpTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private function instantiateJsonRpcMessage( array $data ): JsonRpcMessage {
158158
return new JsonRpcMessage(
159159
new JSONRPCError(
160160
'2.0',
161-
isset( $data['id'] ) ? new RequestId( $data['id'] ) : null,
161+
new RequestId( $data['id'] ?? 0 ),
162162
new JsonRpcErrorObject(
163163
$error_data['code'],
164164
$error_data['message'],
@@ -172,7 +172,7 @@ private function instantiateJsonRpcMessage( array $data ): JsonRpcMessage {
172172
return new JsonRpcMessage(
173173
new JSONRPCResponse(
174174
'2.0',
175-
isset( $data['id'] ) ? new RequestId( $data['id'] ) : null,
175+
new RequestId( $data['id'] ?? 0 ),
176176
$data['result']
177177
)
178178
);

0 commit comments

Comments
 (0)