method; } /** * Gets the path for this route definition. * * @return string Normalized path */ public function getPath(): string { return $this->path; } /** * Gets the handler for this route definition. * * @return string|callable Route handler */ public function getHandler(): string|callable { return $this->handler; } /** * Gets the optional name of this route. * * @return string|null Route name or null */ public function getName(): ?string { return $this->name; } /** * Gets the middleware configuration for this route. * * @return array Middleware configuration */ public function getMiddleware(): array { return $this->middleware; } /** * Gets the validation rules for this route. * * @return array Validation rules */ public function getValidation(): array { return $this->validation; } /** * Gets the default values for parameters. * * @return array Default parameter values */ public function getDefaults(): array { return $this->defaults; } /** * Gets the module identifier for this route. * * @return string|null Module identifier or null */ public function getModule(): ?string { return $this->module; } /** * Gets route attributes for parameter extraction. * * @return array Route attributes */ public function getAttributes(): array { return $this->attributes; } /** * Converts the route definition to an array. * * @return array Plain array representation */ public function toArray(): array { return [ 'method' => $this->method, 'pattern' => $this->pattern, 'path' => $this->path, 'handler' => $this->handler, 'name' => $this->name, 'middleware' => $this->middleware, 'validation' => $this->validation, 'defaults' => $this->defaults, 'module' => $this->module, 'attributes' => $this->attributes ]; } }