Skip to content

Commit 66b4b36

Browse files
authored
Merge pull request #67 from PHPCSStandards/feature/reports-gitblame-fix-fatal-error-subdir-basepath
Gitblame: fix fatal error on `chdir()` when `basepath` is set and phpcs is run from subdir
2 parents af7f3c2 + a2667bc commit 66b4b36

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ The file documents changes to the PHP_CodeSniffer project.
139139
- Thanks to Dan Wallis (@fredden) for the patch
140140
- Fixed bug #3816 : PSR12/FileHeader: bug fix - false positives on PHP 8.2+ readonly classes
141141
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
142+
- Fixed bug #3854 : Fatal error when using Gitblame report in combination with `--basepath` and running from project subdirectory
143+
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
142144
- Fixed bug #3867 : Tokenizer/PHP: union type and intersection type operators were not correctly tokenized for static properties without explicit visibility
143145
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
144146
- Fixed bug #3877 : Filter names can be case-sensitive. The -h help text will now display the correct case for the available filters

src/Reports/VersionControl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class VersionControl implements Report
4040
*/
4141
public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
4242
{
43-
$blames = $this->getBlameContent($report['filename']);
43+
$blames = $this->getBlameContent($phpcsFile->getFilename());
4444

4545
$authorCache = [];
4646
$praiseCache = [];

0 commit comments

Comments
 (0)