<?php

namespace App\Framework\Mcp\ValueObjects;

/**
 * Route-specific information
 */
final readonly class RouteInfo
{
    public function __construct(
        public string  $path,
        public string  $httpMethod,
        public string  $controller,
        public string  $action,
        public ?string $name = null,
        public array   $parameters = [],
        public array   $middleware = []
    ) {}

    public function toArray(): array
    {
        return [
            'path' => $this->path,
            'http_method' => $this->httpMethod,
            'controller' => $this->controller,
            'action' => $this->action,
            'name' => $this->name,
            'parameters' => $this->parameters,
            'middleware' => $this->middleware,
        ];
    }
}
