handler = Closure::fromCallable($handler); if (null !== $segment) { $this->segment = $segment; } } public function getMethod(): HttpMethod { return $this->method; } public function setSegment(PathSegment $segment): void { $this->segment = $segment; } public function setGroup(Group $group): void { $this->group = $group; } public function getSegment(): PathSegment { return $this->segment; } /** @param array $parameters */ public function getPath(array $parameters = []): string { return $this->segment->getPath($parameters); } public function getHandler(): Closure { return $this->handler; } public function getGroup(): ?Group { return $this->group; } }