Skip to content

Commit 5e6d791

Browse files
committed
Add section for Filterer Options to README.md
1 parent fcf0255 commit 5e6d791

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,97 @@ of the final filter is set in the result array.
116116

117117
The example above should help clarify all this.
118118

119+
# Filterer Options
120+
121+
## allowUnknowns
122+
123+
#### Summary
124+
125+
Flag to allow elements in unfiltered input that are not present in the filterer specification.
126+
127+
#### Types
128+
129+
* bool
130+
131+
#### Default
132+
133+
The default value is `false`
134+
135+
#### Constant
136+
137+
```php
138+
TraderInteractive\FiltererOptions::ALLOW_UNKNOWNS
139+
```
140+
141+
#### Example
142+
143+
```php
144+
$options = [
145+
TraderInteractive\FiltererOptions::ALLOW_UNKNOWNS => true,
146+
];
147+
148+
$filterer = new TraderInteractive\Filterer($specification, $options);
149+
```
150+
151+
## defaultRequired
152+
153+
#### Summary
154+
155+
Flag for the default required behavior of all elements in the filterer specification. If `true` all elements in the specification are required unless they have the required filter option set.
156+
157+
#### Types
158+
159+
* bool
160+
161+
#### Default
162+
163+
The default value is `false`
164+
165+
#### Constant
166+
167+
```php
168+
TraderInteractive\FiltererOptions::DEFAULT_REQUIRED
169+
```
170+
171+
#### Example
172+
173+
```php
174+
$options = [
175+
TraderInteractive\FiltererOptions::DEFAULT_REQUIRED => true,
176+
];
177+
178+
$filterer = new TraderInteractive\Filterer($specification, $options);
179+
```
180+
181+
## responseType
182+
183+
#### Summary
184+
185+
Specifies the type of response which The Filterer::filter method will return. It can be `array` or `\TraderInteractive\FilterResponse`
186+
187+
#### Types
188+
189+
* string
190+
191+
#### Default
192+
193+
The default value is `array`
194+
195+
#### Constant
196+
197+
```php
198+
TraderInteractive\FiltererOptions::RESPONSE_TYPE
199+
```
200+
201+
#### Example
202+
203+
```php
204+
$options = [
205+
TraderInteractive\FiltererOptions::RESPONSE_TYPE => \TraderInteractive\FilterResponse::class,
206+
];
207+
208+
$filterer = new TraderInteractive\Filterer($specification, $options);
209+
```
119210
# Filter Options
120211

121212
## required

0 commit comments

Comments
 (0)