Skip to content

Commit 296e2be

Browse files
[12.x] Format code examples in helpers.md for consistency (#10210)
* format code examples in helpers.md for better readability * Update helpers.md Co-authored-by: Sebastian Hädrich <[email protected]> --------- Co-authored-by: Sebastian Hädrich <[email protected]>
1 parent 7589d0d commit 296e2be

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

helpers.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -834,15 +834,19 @@ $items = Arr::random($array, 2);
834834

835835
The `Arr::reject` method removes items from an array using the given closure:
836836

837-
use Illuminate\Support\Arr;
837+
```php
838+
<?php
838839

839-
$array = [100, '200', 300, '400', 500];
840+
use Illuminate\Support\Arr;
840841

841-
$filtered = Arr::reject($array, function (string|int $value, int $key) {
842-
return is_string($value);
843-
});
842+
$array = [100, '200', 300, '400', 500];
844843

845-
// [0 => 100, 2 => 300, 4 => 500]
844+
$filtered = Arr::reject($array, function (string|int $value, int $key) {
845+
return is_string($value);
846+
});
847+
848+
// [0 => 100, 2 => 300, 4 => 500]
849+
```
846850

847851
<a name="method-array-set"></a>
848852
#### `Arr::set()` {.collection-method}

0 commit comments

Comments
 (0)