mirror of
https://hk.gh-proxy.com/https://github.com/mcp-wp/ai-command.git
synced 2025-10-03 10:10:57 +08:00
PHPStan level 8
This commit is contained in:
parent
657d5d56ae
commit
350e12091c
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
parameters:
|
||||
level: 7
|
||||
level: 8
|
||||
paths:
|
||||
- ai-command.php
|
||||
- src/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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']
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue