| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | /** |
| 6: | * This file is part of the Nexus MCP SDK package. |
| 7: | * |
| 8: | * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com> |
| 9: | * |
| 10: | * For the full copyright and license information, please view |
| 11: | * the LICENSE file that was distributed with this source code. |
| 12: | */ |
| 13: | |
| 14: | namespace Nexus\Mcp\Core\Schema\MetaObject; |
| 15: | |
| 16: | use Nexus\Mcp\Core\Schema\MetaObject; |
| 17: | |
| 18: | /** |
| 19: | * The `_meta` of a payload nested inside an envelope rather than of the envelope |
| 20: | * itself, such as a tool, a resource, a prompt, or a content block. It reserves no |
| 21: | * keys of its own, so every entry is an extra. |
| 22: | * |
| 23: | * @extends MetaObject<array<string, mixed>> |
| 24: | */ |
| 25: | final readonly class PayloadMetaObject extends MetaObject |
| 26: | { |
| 27: | #[\Override] |
| 28: | public static function fromArray(array $data): static |
| 29: | { |
| 30: | return new self(extras: $data); |
| 31: | } |
| 32: | |
| 33: | #[\Override] |
| 34: | public function toArray(): array |
| 35: | { |
| 36: | return $this->extras; |
| 37: | } |
| 38: | } |
| 39: |