$currentLinkParts */ public function __construct( private array $allowedItems, private array $currentLinkParts, ) {} /** * @return string[] */ public function getAllowedItems(): array { return $this->allowedItems; } public function addAllowedItem(string $item): self { $this->allowedItems[] = $item; return $this; } public function removeAllowedItem(string $new): self { $this->allowedItems = array_filter($this->allowedItems, static fn(string $item): bool => $item !== $new); return $this; } /** * @return array */ public function getCurrentLinkParts(): array { return $this->currentLinkParts; } }