-
-
Notifications
You must be signed in to change notification settings - Fork 186
Closed
Description
Description
One of the parameters of Dir::index doesn't do anything other than being pass along to a recursive, call where it doesn't do anything again.
Expected behavior
Makes Dir::index ignore file, either by relative name (file.txt), or absolute name.
To reproduce
Just look at the source:
Lines 143 to 165 in 066b050
| public static function index( | |
| string $dir, | |
| bool $recursive = false, | |
| array|null $ignore = null, | |
| string $path = null | |
| ): array { | |
| $result = []; | |
| $dir = realpath($dir); | |
| $items = static::read($dir); | |
| foreach ($items as $item) { | |
| $root = $dir . '/' . $item; | |
| $entry = $path !== null ? $path . '/' . $item : $item; | |
| $result[] = $entry; | |
| if ($recursive === true && is_dir($root) === true) { | |
| $result = array_merge($result, static::index($root, true, $ignore, $entry)); | |
| } | |
| } | |
| return $result; | |
| } | |
$ignore is used only once, and that's when the recursion is called.
Metadata
Metadata
Assignees
Labels
No labels