validate(); } private function validate(): void { if (empty($this->pageTitle)) { throw new \InvalidArgumentException('Page title cannot be empty'); } if (empty($this->menuTitle)) { throw new \InvalidArgumentException('Menu title cannot be empty'); } if (empty($this->capability)) { throw new \InvalidArgumentException('Capability cannot be empty'); } if (empty($this->menuSlug)) { throw new \InvalidArgumentException('Menu slug cannot be empty'); } if ($this->position < 0) { throw new \InvalidArgumentException('Position must be >= 0'); } } public function getPageTitle(): string { return $this->pageTitle; } public function getMenuTitle(): string { return $this->menuTitle; } public function getCapability(): string { return $this->capability; } public function getMenuSlug(): string { return $this->menuSlug; } public function getIcon(): string { return $this->icon; } public function getPosition(): int { return $this->position; } }