Skip to content

Commit f225d90

Browse files
committed
refactor: Improve check mode example
1 parent 23ff154 commit f225d90

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

_docs/check-mode.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,23 @@ JSON Schema for PHP check mode can be configured using the flags from the Constr
1010
or 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

0 commit comments

Comments
 (0)