Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 575 Bytes

SlimCallbackRequestHandler.md

File metadata and controls

26 lines (18 loc) · 575 Bytes

SlimCallbackRequestHandler

Methods

handle

<?php

use Chubbyphp\Framework\RequestHandler\SlimCallbackRequestHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Some\Psr7\ServerRequest;
use Some\Psr7\ResponseFactory;

$request = new ServerRequest();

$responseFactory = new ResponseFactory();

$callbackHandler = new SlimCallbackRequestHandler(
    static fn (ServerRequestInterface $req, ResponseInterface $res, array $args) => $res,
    $responseFactory
);

$response = $callbackHandler->handle($request);