PHP Class Psr7Middlewares\Middleware\JsonSchema

Afficher le fichier Open project: oscarotero/psr7-middlewares

Méthodes publiques

Méthode Description
__construct ( array $schemas ) JsonSchema constructor.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.

Private Methods

Méthode Description
getSchema ( Psr\Http\Message\ServerRequestInterface $request ) : SplFileObject | null
normalizeFilePath ( $path ) : string

Method Details

__construct() public méthode

JsonSchema constructor.
public __construct ( array $schemas )
$schemas array [uri => file] An associative array of HTTP URI to validation schema

__invoke() public méthode

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
Résultat Psr\Http\Message\ResponseInterface