PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.3
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
convertkit / vendor / wordpress / php-mcp-schema / src / Common / Protocol / DTO / GetTaskPayloadResult.php

GetTaskPayloadResult.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.4.3, at vendor/wordpress/php-mcp-schema/src/Common/Protocol/DTO/GetTaskPayloadResult.php

77 lines 2.0 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\Common\Protocol\DTO;
6
7 use WP\McpSchema\Client\Lifecycle\Union\ClientResultInterface;
8 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
9 use WP\McpSchema\Server\Lifecycle\Union\ServerResultInterface;
10
11 /**
12 * The response to a tasks/result request.
13 * The structure matches the result type of the original request.
14 * For example, a tools/call task would return the CallToolResult structure.
15 *
16 * Note: This class is structurally identical to Result.
17 * It exists as a separate type for semantic distinction per MCP specification.
18 *
19 * @since 2025-11-25
20 *
21 * @mcp-domain Common
22 * @mcp-subdomain Protocol
23 * @mcp-version 2025-11-25
24 * @see Result
25 */
26 class GetTaskPayloadResult extends Result implements ClientResultInterface, ServerResultInterface
27 {
28 use ValidatesRequiredFields;
29
30 /**
31 * Wire keys this class models. Anything else is kept in $additionalProperties.
32 *
33 * @var array<int, string>
34 */
35 private const KNOWN_KEYS = ['_meta'];
36
37 /**
38 * @param array<string, mixed>|null $_meta @since 2025-11-25
39 * @param array<string, mixed>|null $additionalProperties
40 */
41 public function __construct(
42 ?array $_meta = null,
43 ?array $additionalProperties = null
44 ) {
45 parent::__construct($_meta, $additionalProperties);
46 }
47
48 /**
49 * Creates an instance from an array.
50 *
51 * @param array{
52 * _meta?: array<string, mixed>|null
53 * } $data
54 * @phpstan-param array<string, mixed> $data
55 * @return self
56 */
57 public static function fromArray(array $data): self
58 {
59 return new self(
60 self::asArrayOrNull($data['_meta'] ?? null),
61 self::additionalFields($data, self::KNOWN_KEYS)
62 );
63 }
64
65 /**
66 * Converts the instance to an array.
67 *
68 * @return array<string, mixed>
69 */
70 public function toArray(): array
71 {
72 $result = parent::toArray();
73
74 return $result;
75 }
76 }
77