mirror of
https://codeberg.org/reflect/reflect-rules-plugin.git
synced 2025-09-14 08:53:42 +02:00
feat(doc): add Type::ENUM to README
This commit is contained in:
parent
f0377726d5
commit
e9a855aed0
1 changed files with 12 additions and 0 deletions
12
README.md
12
README.md
|
@ -95,8 +95,20 @@ Type|Description
|
||||||
`Type::BOOLEAN`|Value must be a boolean or ([**considered bool for GET rules**](#boolean-coercion-from-string-for-search-parameters))
|
`Type::BOOLEAN`|Value must be a boolean or ([**considered bool for GET rules**](#boolean-coercion-from-string-for-search-parameters))
|
||||||
`Type::ARRAY`|Value must be a JSON array
|
`Type::ARRAY`|Value must be a JSON array
|
||||||
`Type::OBJECT`|Value must be a JSON object
|
`Type::OBJECT`|Value must be a JSON object
|
||||||
|
`Type::ENUM`|Value must be exactly one of pre-defined values ([**more information**](#type-enum))
|
||||||
`Type::NULL`|Value must be null or ([**considered null for GET rules**](#null-coercion-from-string-for-search-parameters))
|
`Type::NULL`|Value must be null or ([**considered null for GET rules**](#null-coercion-from-string-for-search-parameters))
|
||||||
|
|
||||||
|
#### `Type::ENUM`
|
||||||
|
|
||||||
|
Provided value for property must be an exact match of any value provided as an `array` to the second argument of `type(Type::ENUM, <whitelist>)`
|
||||||
|
```php
|
||||||
|
Rules->type(Type::ENUM, [
|
||||||
|
"FOO",
|
||||||
|
"BAR"
|
||||||
|
]);
|
||||||
|
```
|
||||||
|
Any value that isn't `"FOO"` or `"BAR"` will be rejected.
|
||||||
|
|
||||||
#### Boolean coercion from string for search parameters
|
#### Boolean coercion from string for search parameters
|
||||||
Search parameters are read as strings, a boolean is therefor coerced from the following rules.
|
Search parameters are read as strings, a boolean is therefor coerced from the following rules.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue