PluginProbe
ZIP AI – AI Website Builder & AI Agent (Beta) / 0.0.8
ZIP AI – AI Website Builder & AI Agent (Beta) v0.0.8
0.0.10 0.0.9 trunk 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8
zip-ai / lib / php-mcp-schema / src / Server / Core / DTO / CompleteRequestParamsContext.php

CompleteRequestParamsContext.php in ZIP AI – AI Website Builder & AI Agent (Beta) 0.0.8, at lib/php-mcp-schema/src/Server/Core/DTO/CompleteRequestParamsContext.php

77 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace WP\McpSchema\Server\Core\DTO;
6
7 use WP\McpSchema\Common\AbstractDataTransferObject;
8 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
9
10 /**
11 * Additional, optional context for completions
12 *
13 * @mcp-domain Server
14 * @mcp-subdomain Core
15 * @mcp-version 2025-11-25
16 */
17 class CompleteRequestParamsContext extends AbstractDataTransferObject
18 {
19 use ValidatesRequiredFields;
20
21 /**
22 * Previously-resolved variables in a URI template or prompt.
23 *
24 * @var array<string, string>|null
25 */
26 protected ?array $arguments;
27
28 /**
29 * @param array<string, string>|null $arguments
30 */
31 public function __construct(
32 ?array $arguments = null
33 ) {
34 $this->arguments = $arguments;
35 }
36
37 /**
38 * Creates an instance from an array.
39 *
40 * @param array{
41 * arguments?: array<string, string>|null
42 * } $data
43 * @phpstan-param array<string, mixed> $data
44 * @return self
45 */
46 public static function fromArray(array $data): self
47 {
48 return new self(
49 self::asStringMapOrNull($data['arguments'] ?? null)
50 );
51 }
52
53 /**
54 * Converts the instance to an array.
55 *
56 * @return array<string, mixed>
57 */
58 public function toArray(): array
59 {
60 $result = [];
61
62 if ($this->arguments !== null) {
63 $result['arguments'] = $this->arguments;
64 }
65
66 return $result;
67 }
68
69 /**
70 * @return array<string, string>|null
71 */
72 public function getArguments(): ?array
73 {
74 return $this->arguments;
75 }
76 }
77