2017 © Pedro Peláez
 

library expressive-http-method

image

mrferos/expressive-http-method

  • Sunday, October 25, 2015
  • by mrferos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,027 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Expressive Method

Small utility that routes to methods named after HTTP verbs to help make API development easier., (*1)

Installation

Using composer!, (*2)

composer install mrferos/expressive-method

Usage

Example action:, (*3)

<?php
namespace App\Action;

use MrfExpressive\HttpMethodTrait;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

class AcmeAction
{
    use HttpMethodTrait;

    /**
     * For GET method
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface $response
     * @param callable|null $next
     * @return mixed
     */
    public function get(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
    {
        // Do anything here you normally would!
    }
}

That's it!, (*4)

There is also an interface MrfExpressive\HttpMethodInterface that defines methods for all the HTTP verbs., (*5)

The Versions

25/10 2015

2.0.0

2.0.0.0

  Sources   Download

The Requires

 

The Development Requires

24/10 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

24/10 2015

1.0.0

1.0.0.0

  Sources   Download

The Requires

 

The Development Requires