Skip to content

Commit 67ff73a

Browse files
committed
Fix TypeError bug where modifiedFiles is null
SourceFileProcessor::$modifiedFiles ends up being null if the list of modified files is empty. Since it is null, and not an empty string, this would throw a TypeError because null is not an array. The fix is to initialize SourceFileProcessor::$modifiedFiles on object construction.
1 parent 990c5bd commit 67ff73a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPSemVerCheckerGit/SourceFileProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SourceFileProcessor
3939
/**
4040
* @var string[]
4141
*/
42-
private $modifiedFiles;
42+
private $modifiedFiles = [];
4343

4444
/**
4545
* SourceFileProcessor constructor.

0 commit comments

Comments
 (0)