You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
468 B
21 lines
468 B
<?php
|
|
|
|
namespace App\Router\Middleware;
|
|
|
|
use App\Router\Request\IRequest;
|
|
|
|
abstract class Middleware implements IHttpMiddleware {
|
|
protected $next;
|
|
|
|
public function setNext(IHttpMiddleware $nextMiddleware) {
|
|
$this->next = $nextMiddleware;
|
|
}
|
|
|
|
public function handle(IRequest $request, callable $next) {
|
|
if ($this->next !== null) {
|
|
return $this->next->handle($request, $next);
|
|
}
|
|
return $next($request);
|
|
}
|
|
}
|