blob: 62bc48eedc2722bc225868266d2980f6a5e7c33e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php
declare(strict_types=1);
namespace Lightscale\Router;
use Lightscale\Router\Contracts\Strategy;
use Lightscale\Router\Exceptions\NotFoundException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class BasicStrategy implements Strategy
{
public function runRoute(RouteCall $call): ResponseInterface
{
return ($call->route->getHandler())($call);
}
public function notFound(RequestInterface $request): ResponseInterface
{
throw new NotFoundException();
}
}
|