Skip to content

Commit

Permalink
Explain omitted array function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemccaffrey authored Feb 27, 2020
1 parent 3a876a2 commit c59def9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ $output = maybe($entity)->function1()->function2()->return();

Access a value when the current object is an array, which requires specifying the desired index:
```php
$output = maybe($entity)->function1()->array(0)->return();
$output = maybe($entity)->function1()->array(0)->function2()->return();
```

If you omit this function, Maybe will run the next function called on the first item in the array, so this will return the same result:

```php
$output = maybe($entity)->function1()->function2()->return();
```


## Future development

Planned features:
Expand Down

0 comments on commit c59def9

Please sign in to comment.