@@ -55,6 +55,7 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
55
55
'classes ' => '' ,
56
56
'methods ' => '' ,
57
57
'lines ' => '' ,
58
+ 'paths ' => '' ,
58
59
'reset ' => '' ,
59
60
'eol ' => ''
60
61
];
@@ -72,6 +73,10 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
72
73
$ report ->getNumExecutedLines (),
73
74
$ report ->getNumExecutableLines ()
74
75
);
76
+ $ colors ['paths ' ] = $ this ->getCoverageColor (
77
+ $ report ->getNumExecutedPaths (),
78
+ $ report ->getNumExecutablePaths ()
79
+ );
75
80
$ colors ['reset ' ] = $ this ->colors ['reset ' ];
76
81
$ colors ['header ' ] = $ this ->colors ['header ' ];
77
82
$ colors ['eol ' ] = $ this ->colors ['eol ' ];
@@ -110,6 +115,17 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
110
115
$ report ->getNumExecutableLines ()
111
116
);
112
117
118
+ $ paths = sprintf (
119
+ ' Paths: %6s (%d/%d) ' ,
120
+ PHP_CodeCoverage_Util::percent (
121
+ $ report ->getNumExecutedPaths (),
122
+ $ report ->getNumExecutablePaths (),
123
+ true
124
+ ),
125
+ $ report ->getNumExecutedPaths (),
126
+ $ report ->getNumExecutablePaths ()
127
+ );
128
+
113
129
$ padding = max (array_map ('strlen ' , [$ classes , $ methods , $ lines ]));
114
130
115
131
if ($ this ->showOnlySummary ) {
@@ -130,6 +146,7 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
130
146
$ output .= $ this ->format ($ colors ['classes ' ], $ padding , $ classes );
131
147
$ output .= $ this ->format ($ colors ['methods ' ], $ padding , $ methods );
132
148
$ output .= $ this ->format ($ colors ['lines ' ], $ padding , $ lines );
149
+ $ output .= $ this ->format ($ colors ['paths ' ], $ padding , $ paths );
133
150
134
151
if ($ this ->showOnlySummary ) {
135
152
return $ output . PHP_EOL ;
@@ -147,6 +164,8 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
147
164
foreach ($ classes as $ className => $ class ) {
148
165
$ classStatements = 0 ;
149
166
$ coveredClassStatements = 0 ;
167
+ $ classPaths = 0 ;
168
+ $ coveredClassPaths = 0 ;
150
169
$ coveredMethods = 0 ;
151
170
$ classMethods = 0 ;
152
171
@@ -158,6 +177,8 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
158
177
$ classMethods ++;
159
178
$ classStatements += $ method ['executableLines ' ];
160
179
$ coveredClassStatements += $ method ['executedLines ' ];
180
+ $ classPaths += $ method ['executablePaths ' ];
181
+ $ coveredClassPaths += $ method ['executedPaths ' ];
161
182
if ($ method ['coverage ' ] == 100 ) {
162
183
$ coveredMethods ++;
163
184
}
@@ -178,6 +199,8 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
178
199
'methodCount ' => $ classMethods ,
179
200
'statementsCovered ' => $ coveredClassStatements ,
180
201
'statementCount ' => $ classStatements ,
202
+ 'pathsCovered ' => $ coveredClassPaths ,
203
+ 'pathCount ' => $ classPaths ,
181
204
];
182
205
}
183
206
}
@@ -186,6 +209,7 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
186
209
187
210
$ methodColor = '' ;
188
211
$ linesColor = '' ;
212
+ $ pathsColor = '' ;
189
213
$ resetColor = '' ;
190
214
191
215
foreach ($ classCoverage as $ fullQualifiedPath => $ classInfo ) {
@@ -194,12 +218,14 @@ public function process(PHP_CodeCoverage $coverage, $showColors = false)
194
218
if ($ showColors ) {
195
219
$ methodColor = $ this ->getCoverageColor ($ classInfo ['methodsCovered ' ], $ classInfo ['methodCount ' ]);
196
220
$ linesColor = $ this ->getCoverageColor ($ classInfo ['statementsCovered ' ], $ classInfo ['statementCount ' ]);
221
+ $ pathsColor = $ this ->getCoverageColor ($ classInfo ['pathsCovered ' ], $ classInfo ['pathCount ' ]);
197
222
$ resetColor = $ colors ['reset ' ];
198
223
}
199
224
200
225
$ output .= PHP_EOL . $ fullQualifiedPath . PHP_EOL
201
226
. ' ' . $ methodColor . 'Methods: ' . $ this ->printCoverageCounts ($ classInfo ['methodsCovered ' ], $ classInfo ['methodCount ' ], 2 ) . $ resetColor . ' '
202
227
. ' ' . $ linesColor . 'Lines: ' . $ this ->printCoverageCounts ($ classInfo ['statementsCovered ' ], $ classInfo ['statementCount ' ], 3 ) . $ resetColor
228
+ . ' ' . $ pathsColor . ' Paths: ' . $ this ->printCoverageCounts ($ classInfo ['pathsCovered ' ], $ classInfo ['pathCount ' ], 2 ) . $ resetColor
203
229
;
204
230
}
205
231
}
0 commit comments