1 | <?php |
||
8 | class JsonSchema |
||
9 | { |
||
10 | /** @var string[] */ |
||
11 | private $schemas; |
||
12 | |||
13 | /** |
||
14 | * JsonSchema constructor. |
||
15 | * |
||
16 | * @param string[] $schemas [uri => file] An associative array of HTTP URI to validation schema |
||
17 | */ |
||
18 | public function __construct(array $schemas) |
||
22 | |||
23 | /** |
||
24 | * Execute the middleware. |
||
25 | * |
||
26 | * @param ServerRequestInterface $request |
||
27 | * @param ResponseInterface $response |
||
28 | * @param callable $next |
||
29 | * |
||
30 | * @return ResponseInterface |
||
31 | */ |
||
32 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
43 | |||
44 | /** |
||
45 | * @param ServerRequestInterface $request |
||
46 | * |
||
47 | * @return \SplFileObject|null |
||
48 | */ |
||
49 | private function getSchema(ServerRequestInterface $request) |
||
62 | |||
63 | /** |
||
64 | * @param string |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | private function normalizeFilePath($path) |
||
77 | } |
||
78 |