PHP Class Psr7Middlewares\Middleware\EncodingNegotiator

Inheritance: use trait Psr7Middlewares\Utils\NegotiateTrait, use trait Psr7Middlewares\Utils\AttributeTrait
Show file Open project: oscarotero/psr7-middlewares Class Usage Examples

Public Methods

Method Description
__construct ( array $encodings = null ) Constructor. Defines de available encodings.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
encodings ( array $encodings ) : self Configure the available encodings.
getEncoding ( Psr\Http\Message\ServerRequestInterface $request ) : string | null Returns the encoding.

Method Details

__construct() public method

Constructor. Defines de available encodings.
public __construct ( array $encodings = null )
$encodings array

__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

encodings() public method

Configure the available encodings.
public encodings ( array $encodings ) : self
$encodings array
return self

getEncoding() public static method

Returns the encoding.
public static getEncoding ( Psr\Http\Message\ServerRequestInterface $request ) : string | null
$request Psr\Http\Message\ServerRequestInterface
return string | null