for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mosaic\Http\Middleware;
use Mosaic\Http\Adapters\Psr7\Response;
use Mosaic\Http\ResponseFactory;
use Mosaic\Routing\RouteDispatcher;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class DispatchRequest
{
/**
* @var ResponseFactory
*/
private $factory;
* @var RouteDispatcher
private $dispatcher;
* @param RouteDispatcher $dispatcher
* @param ResponseFactory $factory
public function __construct(
RouteDispatcher $dispatcher,
ResponseFactory $factory
) {
$this->factory = $factory;
$this->dispatcher = $dispatcher;
}
* @param RequestInterface $request
* @param ResponseInterface $response
* @param callable $next
* @return Response
public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next = null)
$response
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$next
return $this->factory->make(
$this->dispatcher->dispatch($request)
);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.