PHPStan level 8

This commit is contained in:
Pascal Birchler 2025-04-25 10:03:57 +02:00
parent 657d5d56ae
commit 350e12091c
No known key found for this signature in database
GPG key ID: 0DECE73DD74E8B2F
3 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
parameters:
level: 7
level: 8
paths:
- ai-command.php
- src/

View file

@ -20,7 +20,7 @@ use function cli\prompt;
/**
* AI client class.
*
* @phpstan-type ToolDefinition array{name: string, description: string, parameters: array<string, array<string, mixed>>, server: string, callback: callable}
* @phpstan-type ToolDefinition array{name: string, description: string|null, parameters: array<string, array<string, mixed>>, server: string, callback: callable}
*/
class AiClient {
private bool $needs_approval = true;

View file

@ -158,7 +158,7 @@ class HttpTransport {
return new JsonRpcMessage(
new JSONRPCError(
'2.0',
isset( $data['id'] ) ? new RequestId( $data['id'] ) : null,
new RequestId( $data['id'] ?? 0 ),
new JsonRpcErrorObject(
$error_data['code'],
$error_data['message'],
@ -172,7 +172,7 @@ class HttpTransport {
return new JsonRpcMessage(
new JSONRPCResponse(
'2.0',
isset( $data['id'] ) ? new RequestId( $data['id'] ) : null,
new RequestId( $data['id'] ?? 0 ),
$data['result']
)
);