id = $id; $this->icon = $icon; $this->label = $label; $this->weight = $weight; $this->data = $data; } public function jsonSerialize(): array { $data = $this->data; // Add 'id' into the 'data' array, for easier access with OOUI's getData() method $data['id'] = $this->id; return [ 'id' => $this->id, 'data' => $data, 'icon' => $this->icon, 'label' => $this->label, ]; } public function getId(): string { return $this->id; } public function getWeight(): int { return $this->weight; } }