<?php
namespace Skeleton\Router;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

class ControllerMiddleware implements MiddlewareInterface
{

    private string $controllerClass;

    public function __construct(string $controllerClass)
    {
        $this->controllerClass = $controllerClass;
    }

    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        throw new \Exception('This middleware is not actually used');
        //return $this->callable($request);
    }

    public function getControllerClass() :string
    {
        return $this->controllerClass;
    }
}
