PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / wordpress / php-mcp-schema / src / Common / Protocol / DTO / CancelledNotification.php
ameliabooking / vendor / wordpress / php-mcp-schema / src / Common / Protocol / DTO Last commit date
Annotations.php 1 month ago BaseMetadata.php 1 month ago BlobResourceContents.php 1 month ago CancelledNotification.php 1 month ago CancelledNotificationParams.php 1 month ago EmbeddedResource.php 1 month ago EmptyResult.php 1 month ago GetTaskPayloadRequest.php 1 month ago GetTaskPayloadRequestParams.php 1 month ago GetTaskPayloadResult.php 1 month ago Icons.php 1 month ago InitializeRequest.php 1 month ago InitializeRequestParams.php 1 month ago InitializeResult.php 1 month ago InitializedNotification.php 1 month ago PaginatedRequest.php 1 month ago PaginatedRequestParams.php 1 month ago PaginatedResult.php 1 month ago PingRequest.php 1 month ago ProgressNotification.php 1 month ago ProgressNotificationParams.php 1 month ago Result.php 1 month ago TextResourceContents.php 1 month ago URLElicitationRequiredError.php 1 month ago
CancelledNotification.php
107 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace WP\McpSchema\Common\Protocol\DTO;
6
7 use WP\McpSchema\Common\JsonRpc\DTO\JSONRPCNotification;
8 use WP\McpSchema\Common\Protocol\Union\ClientNotificationInterface;
9 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
10 use WP\McpSchema\Server\Lifecycle\Union\ServerNotificationInterface;
11
12 /**
13 * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
14 *
15 * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
16 *
17 * This notification indicates that the result will be unused, so any associated processing SHOULD cease.
18 *
19 * A client MUST NOT attempt to cancel its `initialize` request.
20 *
21 * For task cancellation, use the `tasks/cancel` request instead of this notification.
22 *
23 * @since 2024-11-05
24 * @last-updated 2025-11-25 (modified property: params)
25 *
26 * @mcp-domain Common
27 * @mcp-subdomain Protocol
28 * @mcp-version 2025-11-25
29 */
30 class CancelledNotification extends JSONRPCNotification implements ClientNotificationInterface, ServerNotificationInterface
31 {
32 use ValidatesRequiredFields;
33
34 public const METHOD = 'notifications/cancelled';
35
36 public const DISCRIMINATOR_FIELD = 'method';
37 public const DISCRIMINATOR_VALUE = 'notifications/cancelled';
38
39 /**
40 * @var \WP\McpSchema\Common\Protocol\DTO\CancelledNotificationParams
41 */
42 protected CancelledNotificationParams $typedParams;
43
44 /**
45 * @param '2.0' $jsonrpc @since 2025-11-25
46 * @param \WP\McpSchema\Common\Protocol\DTO\CancelledNotificationParams $params @since 2024-11-05
47 */
48 public function __construct(
49 string $jsonrpc,
50 CancelledNotificationParams $params
51 ) {
52 parent::__construct(self::METHOD, $jsonrpc, null);
53 $this->typedParams = $params;
54 }
55
56 /**
57 * Creates an instance from an array.
58 *
59 * @param array{
60 * jsonrpc: '2.0',
61 * method: 'notifications/cancelled',
62 * params: array<string, mixed>|\WP\McpSchema\Common\Protocol\DTO\CancelledNotificationParams
63 * } $data
64 * @phpstan-param array<string, mixed> $data
65 * @return self
66 */
67 public static function fromArray(array $data): self
68 {
69 self::assertRequired($data, ['jsonrpc', 'params']);
70
71 /** @var '2.0' $jsonrpc */
72 $jsonrpc = self::asString($data['jsonrpc']);
73
74 /** @var \WP\McpSchema\Common\Protocol\DTO\CancelledNotificationParams $params */
75 $params = is_array($data['params'])
76 ? CancelledNotificationParams::fromArray(self::asArray($data['params']))
77 : $data['params'];
78
79 return new self(
80 $jsonrpc,
81 $params
82 );
83 }
84
85 /**
86 * Converts the instance to an array.
87 *
88 * @return array<string, mixed>
89 */
90 public function toArray(): array
91 {
92 $result = parent::toArray();
93
94 $result['params'] = $this->typedParams->toArray();
95
96 return $result;
97 }
98
99 /**
100 * @return \WP\McpSchema\Common\Protocol\DTO\CancelledNotificationParams
101 */
102 public function getTypedParams(): CancelledNotificationParams
103 {
104 return $this->typedParams;
105 }
106 }
107