Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class JsonSchemaRequest extends Request implements ValidatesWhenResolved |
||
14 | { |
||
15 | use ValidatesWhenResolvedTrait; |
||
16 | |||
17 | protected Container $container; |
||
18 | |||
19 | protected ?ValidatorContract $validator = null; |
||
20 | |||
21 | 2 | public function getValidatorInstance() |
|
22 | { |
||
23 | 2 | if (!$this->validator) { |
|
24 | 2 | $this->validator = new JsonSchemaValidator( |
|
25 | 2 | $this->container->make(\JsonSchema\Validator::class), |
|
26 | 2 | $this->container->call([$this, 'schema']), |
|
|
|||
27 | 2 | $this->json()->all(), |
|
28 | ); |
||
29 | } |
||
30 | |||
31 | 2 | return $this->validator; |
|
32 | } |
||
33 | |||
34 | 2 | public function setContainer(Container $container) |
|
35 | { |
||
36 | 2 | $this->container = $container; |
|
37 | |||
38 | 2 | return $this; |
|
39 | } |
||
40 | |||
41 | 1 | public function failedValidation(JsonSchemaValidator $validator) |
|
44 | } |
||
45 | |||
46 | 1 | public function validated() |
|
49 | } |
||
50 | } |
||
51 |