From b2a86c7df7d5a473e80034832a01b21444fa50e6 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 6 Mar 2022 00:48:14 +0100 Subject: Refactor --- src/Utilities.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Utilities.php (limited to 'src/Utilities.php') diff --git a/src/Utilities.php b/src/Utilities.php new file mode 100644 index 0000000..0462ad6 --- /dev/null +++ b/src/Utilities.php @@ -0,0 +1,40 @@ + $path . '/' . $item, + array_filter( + scandir($path), fn ($item) => ! in_array($item, ['.', '..']) + ) + ) + ); + } + + public function scandirMultiple(string|array $paths): array + { + $paths = (array)$paths; + + $merged = []; + foreach ($paths as $path) { + $scanned = $this->scandir($path); + array_push($merged, ...$scanned); + } + + return $merged; + } +} -- cgit v1.2.3