From eb8f1fd61b46ba36424608360a7a7bbff8915f9b Mon Sep 17 00:00:00 2001 From: Utsav Somaiya Date: Wed, 30 Oct 2024 13:55:26 +0530 Subject: [PATCH] fix: pint --- app/Contracts/PathsRepository.php | 1 - app/Project.php | 2 +- app/Repositories/GitPathsRepository.php | 10 +++++----- tests/Feature/StagedTest.php | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Contracts/PathsRepository.php b/app/Contracts/PathsRepository.php index e6fb68eb..36b21fa4 100644 --- a/app/Contracts/PathsRepository.php +++ b/app/Contracts/PathsRepository.php @@ -11,7 +11,6 @@ interface PathsRepository */ public function dirty(); - /** * Determine the "staged" files. * diff --git a/app/Project.php b/app/Project.php index 6267d687..09d46196 100644 --- a/app/Project.php +++ b/app/Project.php @@ -19,7 +19,7 @@ public static function paths($input) } if ($input->getOption('staged')) { - return static::resolveStagedPaths(); + return static::resolveStagedPaths(); } return $input->getArgument('path'); diff --git a/app/Repositories/GitPathsRepository.php b/app/Repositories/GitPathsRepository.php index 0efc773d..46dd7626 100644 --- a/app/Repositories/GitPathsRepository.php +++ b/app/Repositories/GitPathsRepository.php @@ -68,22 +68,22 @@ public function staged() { $process = tap(new Process(['git', 'diff', '--cached', '--name-only', '--diff-filter=ACM', '--', '**.php']))->run(); - if (! $process->isSuccessful()) { + if (! $process->isSuccessful()) { abort(1, 'The [--staged] option is only available when using Git.'); - } + } - $stagedFiles = collect(preg_split('/\R+/', $process->getOutput(), flags: PREG_SPLIT_NO_EMPTY)) + $stagedFiles = collect(preg_split('/\R+/', $process->getOutput(), flags: PREG_SPLIT_NO_EMPTY)) ->map(function ($file) { if (PHP_OS_FAMILY === 'Windows') { $file = str_replace('/', DIRECTORY_SEPARATOR, $file); } - return $this->path . DIRECTORY_SEPARATOR . $file; + return $this->path.DIRECTORY_SEPARATOR.$file; }) ->values() ->all(); - $files = array_values(array_map(function ($splFile) { + $files = array_values(array_map(function ($splFile) { return $splFile->getPathname(); }, iterator_to_array(ConfigurationFactory::finder() ->in($this->path) diff --git a/tests/Feature/StagedTest.php b/tests/Feature/StagedTest.php index 9882c9b0..d36958d0 100644 --- a/tests/Feature/StagedTest.php +++ b/tests/Feature/StagedTest.php @@ -9,7 +9,7 @@ ->shouldReceive('staged') ->once() ->andReturn([ - base_path('tests/Fixtures/without-issues-laravel/file.php'), + base_path('tests/Fixtures/without-issues-laravel/file.php'), ]); $this->swap(PathsRepository::class, $paths);