2017 © Pedro Peláez
 

library middleware-callable

Psr-15 middleware proxying a callable

image

ellipse/middleware-callable

Psr-15 middleware proxying a callable

  • Tuesday, March 13, 2018
  • by pmall
  • Repository
  • 1 Watchers
  • 0 Stars
  • 91 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Middleware callable

This package provides a Psr-15 middleware proxying a callable., (*1)

Require php >= 7.0, (*2)

Installation composer require ellipse/middleware-callable, (*3)

Run tests ./vendor/bin/kahlan, (*4)

Using callables as middleware

The class Ellipse\Middleware\CallableMiddleware can be wrapped around a callable in order to use it as a middleware., (*5)

As any middleware ->process() method, the callable receive implementations of Psr\Http\Message\ServerRequestInterface and Psr\Http\Server\RequestHandlerInterface as parameters and should return an implementation of Psr\Http\Message\ResponseInterface., (*6)

<?php

namespace App;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

use Ellipse\Middleware\CallableMiddleware;

// This middleware is wrapped around the given callable.
$middleware = new CallableMiddleware(function (ServerRequestInterface $request, RequestHandlerInterface $handler) {

    // ...

    return $handler->handle($request);

});

// The middleware ->process() method proxy the callable.
$response = $middleware->process($request, $handler);

The Versions

13/03 2018

dev-master

9999999-dev https://github.com/ellipsephp/middleware-callable

Psr-15 middleware proxying a callable

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pierre Mallinjoud

middleware resolver callable factory psr-15

04/03 2018

1.0.1

1.0.1.0 https://github.com/ellipsephp/middleware-callable

Psr-15 middleware proxying a callable

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pierre Mallinjoud

middleware callable psr-15

30/01 2018

1.0.0

1.0.0.0 https://github.com/ellipsephp/middleware-callable

Psr-15 middleware proxying a callable

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pierre Mallinjoud

middleware callable psr-15