PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / vendor / wordpress / php-mcp-schema / src / Common / JsonRpc / DTO / RequestParamsMeta.php

RequestParamsMeta.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.3, at vendor/wordpress/php-mcp-schema/src/Common/JsonRpc/DTO/RequestParamsMeta.php

82 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\JsonRpc\DTO;
6
7 use WP\McpSchema\Common\AbstractDataTransferObject;
8 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
9
10 /**
11 * See [General fields: `_meta`](/specification/2025-11-25/basic/index#meta) for notes on `_meta` usage.
12 *
13 * @mcp-domain Common
14 * @mcp-subdomain JsonRpc
15 * @mcp-version 2025-11-25
16 */
17 class RequestParamsMeta extends AbstractDataTransferObject
18 {
19 use ValidatesRequiredFields;
20
21 /**
22 * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
23 *
24 * @var string|number|null
25 */
26 protected $progressToken;
27
28 /**
29 * @param string|number|null $progressToken
30 */
31 public function __construct(
32 $progressToken = null
33 ) {
34 $this->progressToken = $progressToken;
35 }
36
37 /**
38 * Creates an instance from an array.
39 *
40 * @param array{
41 * progressToken?: string|number|null
42 * } $data
43 * @phpstan-param array<string, mixed> $data
44 * @return self
45 */
46 public static function fromArray(array $data): self
47 {
48 /** @var string|number|null $progressToken */
49 $progressToken = isset($data['progressToken'])
50 ? self::asStringOrNumberOrNull($data['progressToken'])
51 : null;
52
53 return new self(
54 $progressToken
55 );
56 }
57
58 /**
59 * Converts the instance to an array.
60 *
61 * @return array<string, mixed>
62 */
63 public function toArray(): array
64 {
65 $result = [];
66
67 if ($this->progressToken !== null) {
68 $result['progressToken'] = $this->progressToken;
69 }
70
71 return $result;
72 }
73
74 /**
75 * @return string|number|null
76 */
77 public function getProgressToken()
78 {
79 return $this->progressToken;
80 }
81 }
82