Skip to content

Commit 3a68f06

Browse files
authored
Merge pull request #23 from igorsgm/develop
Fix: Code Analyzer Hooks
2 parents c21208b + f13130f commit 3a68f06

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Console/Commands/Hooks/BaseCodeAnalyzerPreCommitHook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function __construct()
7474
*/
7575
public function handleCommittedFiles(ChangedFiles $files, Closure $next)
7676
{
77-
$commitFiles = $files->getAddedToCommit();
77+
$commitFiles = $files->getStaged();
7878

7979
if ($commitFiles->isEmpty() || GitHooks::isMergeInProgress()) {
8080
return $next($files);

tests/Features/Commands/Hooks/BaseCodeAnalyzerPreCommitHookTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
$this->initializeTempDirectory(base_path('temp'));
1010
});
1111

12-
test('Skips check if there are no files added to commit', function () {
12+
test('Skips check if there are no staged files in commit', function () {
1313
$changedFiles = mock(ChangedFiles::class)
14-
->shouldReceive('getAddedToCommit')
14+
->shouldReceive('getStaged')
1515
->andReturn(collect())
1616
->getMock();
1717

0 commit comments

Comments
 (0)