|null */ protected ?array $icons; /** * @param array<\WP\McpSchema\Common\Core\DTO\Icon>|null $icons @since 2025-11-25 */ public function __construct( ?array $icons = null ) { $this->icons = $icons; } /** * Creates an instance from an array. * * @param array{ * icons?: array|\WP\McpSchema\Common\Core\DTO\Icon>|null * } $data * @phpstan-param array $data * @return self */ public static function fromArray(array $data): self { /** @var array<\WP\McpSchema\Common\Core\DTO\Icon>|null $icons */ $icons = isset($data['icons']) ? array_map( static fn($item) => is_array($item) ? Icon::fromArray($item) : $item, self::asArray($data['icons']) ) : null; return new self( $icons ); } /** * Converts the instance to an array. * * @return array */ public function toArray(): array { $result = []; if ($this->icons !== null) { $result['icons'] = array_map(static fn($item) => $item->toArray(), $this->icons); } return $result; } /** * @return array<\WP\McpSchema\Common\Core\DTO\Icon>|null */ public function getIcons(): ?array { return $this->icons; } }