diff --git a/packages/framework/src/Foundation/Kernel/Filesystem.php b/packages/framework/src/Foundation/Kernel/Filesystem.php index 9e6d6f408b9..b480e204f64 100644 --- a/packages/framework/src/Foundation/Kernel/Filesystem.php +++ b/packages/framework/src/Foundation/Kernel/Filesystem.php @@ -188,8 +188,6 @@ public function smartGlob(string $pattern, int $flags = 0): Collection /** @return \Illuminate\Support\Collection */ public function findFiles(string $directory, string|array|false $matchExtensions = false, bool $recursive = false): Collection { - $finder = app(FileFinder::class); - - return $finder::handle($directory, $matchExtensions, $recursive); + return app(FileFinder::class)->handle($directory, $matchExtensions, $recursive); } } diff --git a/packages/framework/src/Framework/Actions/Internal/FileFinder.php b/packages/framework/src/Framework/Actions/Internal/FileFinder.php index e596fac7170..014755b1c22 100644 --- a/packages/framework/src/Framework/Actions/Internal/FileFinder.php +++ b/packages/framework/src/Framework/Actions/Internal/FileFinder.php @@ -15,7 +15,7 @@ class FileFinder { /** - * @param string|array|false $matchExtensions + * @param string|array|false $matchExtensions * @return \Illuminate\Support\Collection */ public static function handle(string $directory, string|array|false $matchExtensions = false, bool $recursive = false): Collection @@ -36,8 +36,8 @@ public static function handle(string $directory, string|array|false $matchExtens } $finder->name('/\.('.implode('|', array_map(function (string $extension): string { - return preg_quote(ltrim($extension, '.'), '/'); - }, $matchExtensions)).')$/i'); + return preg_quote(ltrim($extension, '.'), '/'); + }, $matchExtensions)).')$/i'); } return collect($finder)->map(function (string $file): string { diff --git a/packages/framework/tests/Feature/Foundation/FilesystemTest.php b/packages/framework/tests/Feature/Foundation/FilesystemTest.php index d4b9a8aa968..25bf108239f 100644 --- a/packages/framework/tests/Feature/Foundation/FilesystemTest.php +++ b/packages/framework/tests/Feature/Foundation/FilesystemTest.php @@ -432,7 +432,8 @@ public function testFindFilesFromFilesystemFacadeWithArguments() public function testCanSwapOutFileFinder() { app()->bind(FileFinder::class, function () { - return new class { + return new class + { public static function handle(): Collection { return collect(['mocked']);