PHP 클래스 Psr7Middlewares\Middleware\JsonValidator

파일 보기 프로젝트 열기: oscarotero/psr7-middlewares 1 사용 예제들

공개 메소드들

메소드 설명
__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