3434 */
3535final class File extends AbstractNode
3636{
37+ /**
38+ * @var non-empty-string
39+ */
40+ private string $ sha1 ;
41+
3742 /**
3843 * @var array<int, ?list<non-empty-string>>
3944 */
@@ -80,16 +85,18 @@ final class File extends AbstractNode
8085 private array $ codeUnitsByLine = [];
8186
8287 /**
88+ * @param non-empty-string $sha1
8389 * @param array<int, ?list<non-empty-string>> $lineCoverageData
8490 * @param array<string, TestType> $testData
8591 * @param array<string, Class_> $classes
8692 * @param array<string, Trait_> $traits
8793 * @param array<string, Function_> $functions
8894 */
89- public function __construct (string $ name , AbstractNode $ parent , array $ lineCoverageData , array $ functionCoverageData , array $ testData , array $ classes , array $ traits , array $ functions , LinesOfCode $ linesOfCode )
95+ public function __construct (string $ name , AbstractNode $ parent , string $ sha1 , array $ lineCoverageData , array $ functionCoverageData , array $ testData , array $ classes , array $ traits , array $ functions , LinesOfCode $ linesOfCode )
9096 {
9197 parent ::__construct ($ name , $ parent );
9298
99+ $ this ->sha1 = $ sha1 ;
93100 $ this ->lineCoverageData = $ lineCoverageData ;
94101 $ this ->functionCoverageData = $ functionCoverageData ;
95102 $ this ->testData = $ testData ;
@@ -103,6 +110,14 @@ public function count(): int
103110 return 1 ;
104111 }
105112
113+ /**
114+ * @return non-empty-string
115+ */
116+ public function sha1 (): string
117+ {
118+ return $ this ->sha1 ;
119+ }
120+
106121 /**
107122 * @return array<int, ?list<non-empty-string>>
108123 */
0 commit comments