Skip to content

Commit

Permalink
make stan happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjektGopher committed Jan 4, 2025
1 parent c1a694c commit 03423b9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/Repositories/GitPathsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public function dirty()
$dirtyFiles = collect(preg_split('/\R+/', $process->getOutput(), flags: PREG_SPLIT_NO_EMPTY))
->mapWithKeys(fn ($file) => [substr($file, 3) => trim(substr($file, 0, 3))])
->reject(fn ($status) => $status === 'D')
->map(fn ($status, $file) => $status === 'R' ? Str::after($file, ' -> ') : $file);
->map(fn ($status, $file) => $status === 'R' ? Str::after($file, ' -> ') : $file)
->values();

return $this->processFileNames($dirtyFiles);
}
Expand Down Expand Up @@ -69,15 +70,16 @@ public function diff($branch)
->flatten()
->filter()
->unique()
->values();
->values()
->map(fn ($s) => (string) $s);

return $this->processFileNames($files);
}

/**
* Process the files.
*
* @param \Illuminate\Support\Collection<int|string, string> $fileNames
* @param \Illuminate\Support\Collection<int, string> $fileNames
* @return array<int, string>
*/
protected function processFileNames(Collection $fileNames)
Expand All @@ -90,7 +92,6 @@ protected function processFileNames(Collection $fileNames)

return $this->path.DIRECTORY_SEPARATOR.$file;
})
->values()
->all();

$files = array_values(array_map(function ($splFile) {
Expand Down

0 comments on commit 03423b9

Please sign in to comment.