for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\Route\Strategy;
use \Exception;
use League\Route\Http\Exception\MethodNotAllowedException;
use League\Route\Http\Exception\NotFoundException;
use League\Route\Middleware\ExecutionChain;
use League\Route\Route;
use RuntimeException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class ApplicationStrategy implements StrategyInterface
{
/**
* {@inheritdoc}
*/
public function getCallable(Route $route, array $vars)
return function (ServerRequestInterface $request, ResponseInterface $response, callable $next) use ($route, $vars) {
$response = call_user_func_array($route->getCallable(), [$request, $response, $vars]);
if (! $response instanceof ResponseInterface) {
throw new RuntimeException(
'Route callables must return an instance of (Psr\Http\Message\ResponseInterface)'
);
}
return $next($request, $response);
};
public function getNotFoundDecorator(NotFoundException $exception)
throw $exception;
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception)
public function getExceptionDecorator(Exception $exception)