Skip to content

Commit d7068ca

Browse files
committed
Improve documentation v2
1 parent e0a56bc commit d7068ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/04-containers.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,14 @@ echo InnerList::new('foo', 'bar')
438438
// ("foo" "bar");expire=@1681538756;path="/";max-age=2500
439439
```
440440

441+
To ease, usage and validation all containers exposes the `map`, `reduce`, `filter` and `sort` methods.
442+
The methods leverage the result of the `foreach` loop on each container. While the `filter` and `sort` method
443+
will return a new container instance, the `map` method returns an `Iterator`.
444+
441445
Last but not least, all datatypes exposes the conditional `when` method to improve building the structured field.
442446
This can be helpful if fdr instance your input value would otherwise trigger an exception.
443447

444-
In the example below we are conditionally building the an `Item` depending on the data found in the
448+
In the example below we are conditionally building an `Item` depending on the data found in the
445449
`$cache` value object. This is also possible for all containers.
446450

447451
```php

0 commit comments

Comments
 (0)