for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the slince/middleware package.
*
* (c) Slince <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Slince\Middleware;
use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class Delegate implements RequestHandlerInterface
{
/**
* @var callable
protected $callback;
public function __construct(callable $callback)
$this->callback = $callback;
}
* {@inheritdoc}
public function handle(ServerRequestInterface $request): ResponseInterface
return call_user_func($this->callback, $request);