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 / Client / Lifecycle / DTO / ClientCapabilitiesElicitation.php

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

96 lines 1.8 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\Client\Lifecycle\DTO;
6
7 use WP\McpSchema\Common\AbstractDataTransferObject;
8 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
9
10 /**
11 * Present if the client supports elicitation from the server.
12 *
13 * @mcp-domain Client
14 * @mcp-subdomain Lifecycle
15 * @mcp-version 2025-11-25
16 */
17 class ClientCapabilitiesElicitation extends AbstractDataTransferObject
18 {
19 use ValidatesRequiredFields;
20
21 /**
22 * @var object|null
23 */
24 protected ?object $form;
25
26 /**
27 * @var object|null
28 */
29 protected ?object $url;
30
31 /**
32 * @param object|null $form
33 * @param object|null $url
34 */
35 public function __construct(
36 ?object $form = null,
37 ?object $url = null
38 ) {
39 $this->form = $form;
40 $this->url = $url;
41 }
42
43 /**
44 * Creates an instance from an array.
45 *
46 * @param array{
47 * form?: object|null,
48 * url?: object|null
49 * } $data
50 * @phpstan-param array<string, mixed> $data
51 * @return self
52 */
53 public static function fromArray(array $data): self
54 {
55 return new self(
56 self::asObjectOrNull($data['form'] ?? null),
57 self::asObjectOrNull($data['url'] ?? null)
58 );
59 }
60
61 /**
62 * Converts the instance to an array.
63 *
64 * @return array<string, mixed>
65 */
66 public function toArray(): array
67 {
68 $result = [];
69
70 if ($this->form !== null) {
71 $result['form'] = $this->form;
72 }
73 if ($this->url !== null) {
74 $result['url'] = $this->url;
75 }
76
77 return $result;
78 }
79
80 /**
81 * @return object|null
82 */
83 public function getForm(): ?object
84 {
85 return $this->form;
86 }
87
88 /**
89 * @return object|null
90 */
91 public function getUrl(): ?object
92 {
93 return $this->url;
94 }
95 }
96