25
25
* @phpstan-import-type XdebugFunctionCoverageType from XdebugDriver
26
26
*
27
27
* @phpstan-type TestIdType = string
28
+ *
29
+ * @phpstan-type FunctionCoverageDataType array{
30
+ * branches: array<int, array{
31
+ * op_start: int,
32
+ * op_end: int,
33
+ * line_start: int,
34
+ * line_end: int,
35
+ * hit: list<TestIdType>,
36
+ * out: array<int, int>,
37
+ * out_hit: array<int, int>,
38
+ * }>,
39
+ * paths: array<int, array{
40
+ * path: array<int, int>,
41
+ * hit: list<TestIdType>,
42
+ * }>,
43
+ * hit: list<TestIdType>
44
+ * }
45
+ *
46
+ * @phpstan-type FunctionCoverageType array<string, array<string, FunctionCoverageDataType> >
47
+ >>>>>>> Stashed changes
28
48
*/
29
49
final class ProcessedCodeCoverageData
30
50
{
@@ -41,22 +61,7 @@ final class ProcessedCodeCoverageData
41
61
* Maintains base format of raw data (@see https://xdebug.org/docs/code_coverage), but each 'hit' entry is an array
42
62
* of testcase ids.
43
63
*
44
- * @var array<string, array<string, array{
45
- * branches: array<int, array{
46
- * op_start: int,
47
- * op_end: int,
48
- * line_start: int,
49
- * line_end: int,
50
- * hit: list<TestIdType>,
51
- * out: array<int, int>,
52
- * out_hit: array<int, int>,
53
- * }>,
54
- * paths: array<int, array{
55
- * path: array<int, int>,
56
- * hit: list<TestIdType>,
57
- * }>,
58
- * hit: list<TestIdType>
59
- * }>>
64
+ * @var FunctionCoverageType
60
65
*/
61
66
private array $ functionCoverage = [];
62
67
@@ -238,7 +243,7 @@ private function priorityForLine(array $data, int $line): int
238
243
/**
239
244
* For a function we have never seen before, copy all data over and simply init the 'hit' array.
240
245
*
241
- * @param XdebugFunctionCoverageType $functionData
246
+ * @param XdebugFunctionCoverageType|FunctionCoverageDataType $functionData
242
247
*/
243
248
private function initPreviouslyUnseenFunction (string $ file , string $ functionName , array $ functionData ): void
244
249
{
@@ -258,7 +263,7 @@ private function initPreviouslyUnseenFunction(string $file, string $functionName
258
263
* Techniques such as mocking and where the contents of a file are different vary during tests (e.g. compiling
259
264
* containers) mean that the functions inside a file cannot be relied upon to be static.
260
265
*
261
- * @param XdebugFunctionCoverageType $functionData
266
+ * @param XdebugFunctionCoverageType|FunctionCoverageDataType $functionData
262
267
*/
263
268
private function initPreviouslySeenFunction (string $ file , string $ functionName , array $ functionData ): void
264
269
{
0 commit comments