mirror of
https://codeberg.org/reflect/reflect-rules-plugin.git
synced 2025-09-14 00:43:42 +02:00
feat(doc): add strict mode to README
This commit is contained in:
parent
612bb0f271
commit
f1aebe8a02
1 changed files with 10 additions and 0 deletions
10
README.md
10
README.md
|
@ -106,10 +106,20 @@ Error
|
|||
--|
|
||||
[`Error::VALUE_MIN_ERROR`](#min)
|
||||
[`Error::VALUE_MAX_ERROR`](#max)
|
||||
[`Error::UNKNOWN_PROPERTY_NAME`](#strict-mode)
|
||||
[`Error::INVALID_PROPERTY_TYPE`](#type)
|
||||
[`Error::INVALID_PROPERTY_VALUE`](#typeenum)
|
||||
[`Error::MISSING_REQUIRED_PROPERTY`](#required)
|
||||
|
||||
# Strict mode
|
||||
Enable strict mode by initializing a Ruleset with the "strict" argument set to `true`.
|
||||
|
||||
```php
|
||||
new Ruleset(strict: true);
|
||||
```
|
||||
|
||||
Strict mode will not allow undefined properties to be set in all configured scopes. If a property exists in `Scope` that hasn't been defined with a `Rules()` instance, a `Errors::UNKNOWN_PROPERTY_NAME` error will be set.
|
||||
|
||||
# Available rules
|
||||
The following methods can be chained onto a `Rules` instance to enforce certain constraints on a particular property
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue