2017 © Pedro Peláez
 

library server-request-handler

Common interfaces for PSR-7 server request handlers

image

cormy/server-request-handler

Common interfaces for PSR-7 server request handlers

  • Tuesday, November 22, 2016
  • by schnittstabil
  • Repository
  • 1 Watchers
  • 0 Stars
  • 148 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Cormy\Server\RequestHandlerInterface Build Status

SensioLabsInsight, (*1)

:nut_and_bolt: Common interfaces for PSR-7 server request handlers, (*2)

Install

composer require cormy/server-request-handler

Usage

The following snippet utilizes zend-diactoros:, (*3)

composer require zendframework/zend-diactoros
use Cormy\Server\RequestHandlerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response;

class RequestHandler implements RequestHandlerInterface
{
    /**
     * Process an incoming server request and return the response.
     *
     * @param ServerRequestInterface $request
     *
     * @return ResponseInterface
     */
    public function __invoke(ServerRequestInterface $request):ResponseInterface
    {
        $response = new Response();
        $response = $response->withHeader('content-type', 'application/json; charset=utf-8');
        // ...

        return $response;
    }
}

License

MIT © Michael Mayer, (*4)

The Versions

22/11 2016

dev-master

9999999-dev

Common interfaces for PSR-7 server request handlers

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 http request response handler http-message cormy

20/11 2016

0.1.0

0.1.0.0

Common interfaces for PSR-7 server request handlers

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 http request response handler http-message cormy