Skip to content

Commit 93b2647

Browse files
authored
Docs: Autoformat Readme (#21)
1 parent dcabd1a commit 93b2647

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ If your variable is already an instance of `Traversable` (i.e. an `Iterator`, an
3535
If your variable is an array, the function converts it to an `ArrayIterator`.
3636

3737
Usage:
38+
3839
```php
3940
use function BenTools\IterableFunctions\iterable_to_traversable;
4041

4142
var_dump(iterable_to_traversable(['foo', 'bar'])); // \ArrayIterator(['foo', 'bar'])
4243
var_dump(iterable_to_traversable(new \ArrayIterator(['foo', 'bar']))); // \ArrayIterator(['foo', 'bar'])
4344
```
4445

45-
4646
iterable_map()
4747
--------------
4848

@@ -102,6 +102,7 @@ foreach (iterable_filter($generator()) as $item) {
102102
```
103103

104104
Of course you can define your own filter:
105+
105106
```php
106107
use function BenTools\IterableFunctions\iterable_filter;
107108

@@ -126,6 +127,7 @@ Iterable fluent interface
126127
The `iterable` function allows you to wrap an iterable and apply some common operations.
127128

128129
With an array input:
130+
129131
```php
130132
use function BenTools\IterableFunctions\iterable;
131133
$data = [
@@ -138,6 +140,7 @@ $iterable = iterable($data)->filter(fn($eatable) => 'rock' !== $eatable)->map('s
138140
```
139141

140142
With a traversable input:
143+
141144
```php
142145
use function BenTools\IterableFunctions\iterable;
143146
$data = [
@@ -152,20 +155,22 @@ $iterable = iterable($data())->filter(fn($eatable) => 'rock' !== $eatable)->map(
152155
```
153156

154157
Array output:
158+
155159
```php
156160
$iterable->asArray(); // array ['banana', 'pineapple']
157161
```
158162

159-
160163
Installation
161164
============
162165

163166
With composer (they'll be autoloaded):
167+
164168
```
165169
composer require bentools/iterable-functions
166170
```
167171

168172
Or manually:
173+
169174
```php
170175
require_once '/path/to/this/library/src/iterable-functions.php';
171176
```

0 commit comments

Comments
 (0)