for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of coisa/http.
*
* (c) Felipe Sayão Lobato Abreu <[email protected]>
* This source file is subject to the license that is bundled
* with this source code in the file LICENSE.
*/
declare(strict_types=1);
namespace CoiSA\Http\Handler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
* Class CallableHandler
* @package CoiSA\Http\Handler
class CallableHandler implements RequestHandlerInterface
{
* @var callable
private $callback;
* CallableHandler constructor.
* @param callable $callback
public function __construct(callable $callback)
$this->callback = $callback;
}
* {@inheritdoc}
public function handle(ServerRequestInterface $request): ResponseInterface
return \call_user_func($this->callback, $request);