PHP Class Psr7Middlewares\Middleware\MethodOverride

Show file Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
get ( array $methods ) : self Set allowed method for GET.
parameter ( string $name, boolean $get = true ) : self Configure the parameters.
post ( array $methods ) : self Set allowed method for POST.

Private Methods

Method Description
getAllowedOverrideMethods ( Psr\Http\Message\ServerRequestInterface $request ) : array Returns the allowed override methods.
getOverrideMethod ( Psr\Http\Message\ServerRequestInterface $request ) : string Returns the override method.

Method Details

__invoke() public method

Execute the middleware.
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
return Psr\Http\Message\ResponseInterface

get() public method

Set allowed method for GET.
public get ( array $methods ) : self
$methods array
return self

parameter() public method

Configure the parameters.
public parameter ( string $name, boolean $get = true ) : self
$name string
$get boolean
return self

post() public method

Set allowed method for POST.
public post ( array $methods ) : self
$methods array
return self