File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,23 @@ JSON Schema for PHP check mode can be configured using the flags from the Constr
1010or provided for a single ` validate() ` call.
1111
1212``` php
13- $checkMode = Constraint::CHECK_MODE_NORMAL | Constraint::CHECK_MODE_VALIDATE_SCHEMA | Constraint::CHECK_MODE_APPLY_DEFAULTS ;
13+ $checkMode = Constraint::CHECK_MODE_NORMAL | Constraint::CHECK_MODE_VALIDATE_SCHEMA;
1414
15- $validator = new Validator(new Factory(null, null, $checkMode)); // Setting the default check mode for all validate calls.
16- $validator->validate($data, $schema, $checkMode); // Or set the check mode for this validation call.
15+ $validator = new Validator(
16+ new Factory(
17+ null,
18+ null,
19+ $checkMode // Setting the default check mode for all validate calls.
20+ )
21+ );
22+
23+ // -- OR --
24+
25+ $validator->validate(
26+ $data,
27+ $schema,
28+ $checkMode // Or set the check mode for this validation call.
29+ );
1730```
1831
1932
You can’t perform that action at this time.
0 commit comments