for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the http-middleware package.
*
* Copyright (c) Dusan Vejin
* For full copyright and license information, please refer to the LICENSE file,
* located at the package root folder.
*/
declare(strict_types=1);
namespace WeCodeIn\Http\Server\Middleware;
use Interop\Http\Server\RequestHandlerInterface;
use Interop\Http\Server\MiddlewareInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class CallableMiddleware implements MiddlewareInterface
{
protected $callable;
public function __construct(callable $callable)
$this->callable = $callable;
}
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
return ($this->callable)($request, $handler);