From 4c68ae6febbefb54188887241fe41036bae83c15 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 10 Dec 2024 14:45:13 +0100 Subject: [PATCH] Cleanup code --- .../framework/src/Console/Commands/PublishViewsCommand.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/framework/src/Console/Commands/PublishViewsCommand.php b/packages/framework/src/Console/Commands/PublishViewsCommand.php index 71bac636dec..a37930dad0d 100644 --- a/packages/framework/src/Console/Commands/PublishViewsCommand.php +++ b/packages/framework/src/Console/Commands/PublishViewsCommand.php @@ -11,6 +11,7 @@ use Illuminate\Support\Facades\File; use Illuminate\Support\ServiceProvider; +use Symfony\Component\Finder\SplFileInfo; use function Hyde\path_join; use function str_replace; use function sprintf; @@ -120,13 +121,10 @@ protected function handleInteractivePublish(): void $source = key($paths); $target = $paths[$source]; - $sourceBaseDir = basename($source); - $targetBaseDir = basename($target); - // Now we need an array that maps all source files to their target paths retaining the directory structure $search = File::allFiles($source); - $files = collect($search)->mapWithKeys(function (\Symfony\Component\Finder\SplFileInfo $file) use ($source, $target, $sourceBaseDir, $targetBaseDir) { + $files = collect($search)->mapWithKeys(/** @return array */ function (SplFileInfo $file) use ($source, $target): array { $targetPath = path_join($target, $file->getRelativePathname()); return [Hyde::pathToRelative(realpath($file->getPathname())) => Hyde::pathToRelative($targetPath)];