| 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 (a tool, a resource, a prompt, a content block), |
| 20: | * reserving no keys of its own. |
| 21: | * |
| 22: | * @extends MetaObject<array<array-key, mixed>> |
| 23: | */ |
| 24: | final readonly class PayloadMetaObject extends MetaObject |
| 25: | { |
| 26: | #[\Override] |
| 27: | public static function fromArray(array $data): static |
| 28: | { |
| 29: | return new self(extras: $data); |
| 30: | } |
| 31: | |
| 32: | #[\Override] |
| 33: | public function toArray(): array |
| 34: | { |
| 35: | return $this->extras; |
| 36: | } |
| 37: | } |
| 38: |