PHP Класс Psr7Middlewares\Middleware\JsonValidator

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( stdClass $schema ) JsonSchema constructor.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
fromArray ( array $json ) : static | callable
fromDecodedObject ( stdClass $schema ) : static | callable
fromEncodedString ( string $json ) : static | callable
fromFile ( SplFileObject $file ) : static | callable

Приватные методы

Метод Описание
invalidateResponse ( Psr\Http\Message\ResponseInterface $response, string $reason, array $headers = [], string | null $body = null ) : Psr\Http\Message\ResponseInterface

Описание методов

__construct() публичный метод

Consider using one of the following factories instead of invoking the controller directly: - JsonValidator::fromFile() - JsonValidator::fromEncodedString() - JsonValidator::fromDecodedObject() - JsonValidator::fromArray()
public __construct ( stdClass $schema )
$schema stdClass A JSON-decoded object-representation of the schema.

__invoke() публичный метод

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
Результат Psr\Http\Message\ResponseInterface

fromArray() публичный статический метод

public static fromArray ( array $json ) : static | callable
$json array
Результат static | callable

fromDecodedObject() публичный статический метод

public static fromDecodedObject ( stdClass $schema ) : static | callable
$schema stdClass
Результат static | callable

fromEncodedString() публичный статический метод

public static fromEncodedString ( string $json ) : static | callable
$json string
Результат static | callable

fromFile() публичный статический метод

public static fromFile ( SplFileObject $file ) : static | callable
$file SplFileObject
Результат static | callable