@@ -84,12 +84,14 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
84
84
$ report = $ coverage ->getReport ();
85
85
86
86
$ colors = [
87
- 'header ' => '' ,
88
- 'classes ' => '' ,
89
- 'methods ' => '' ,
90
- 'lines ' => '' ,
91
- 'reset ' => '' ,
92
- 'eol ' => '' ,
87
+ 'header ' => '' ,
88
+ 'classes ' => '' ,
89
+ 'methods ' => '' ,
90
+ 'lines ' => '' ,
91
+ 'branches ' => '' ,
92
+ 'paths ' => '' ,
93
+ 'reset ' => '' ,
94
+ 'eol ' => '' ,
93
95
];
94
96
95
97
if ($ showColors ) {
@@ -108,13 +110,23 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
108
110
$ report ->getNumExecutableLines ()
109
111
);
110
112
113
+ $ colors ['branches ' ] = $ this ->getCoverageColor (
114
+ $ report ->getNumTestedBranches (),
115
+ $ report ->getNumBranches ()
116
+ );
117
+
118
+ $ colors ['paths ' ] = $ this ->getCoverageColor (
119
+ $ report ->getNumTestedPaths (),
120
+ $ report ->getNumPaths ()
121
+ );
122
+
111
123
$ colors ['reset ' ] = self ::COLOR_RESET ;
112
124
$ colors ['header ' ] = self ::COLOR_HEADER ;
113
125
$ colors ['eol ' ] = self ::COLOR_EOL ;
114
126
}
115
127
116
128
$ classes = \sprintf (
117
- ' Classes: %6s (%d/%d) ' ,
129
+ ' Classes: %6s (%d/%d) ' ,
118
130
Util::percent (
119
131
$ report ->getNumTestedClassesAndTraits (),
120
132
$ report ->getNumClassesAndTraits (),
@@ -125,7 +137,7 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
125
137
);
126
138
127
139
$ methods = \sprintf (
128
- ' Methods: %6s (%d/%d) ' ,
140
+ ' Methods: %6s (%d/%d) ' ,
129
141
Util::percent (
130
142
$ report ->getNumTestedMethods (),
131
143
$ report ->getNumMethods (),
@@ -136,7 +148,7 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
136
148
);
137
149
138
150
$ lines = \sprintf (
139
- ' Lines: %6s (%d/%d) ' ,
151
+ ' Lines: %6s (%d/%d) ' ,
140
152
Util::percent (
141
153
$ report ->getNumExecutedLines (),
142
154
$ report ->getNumExecutableLines (),
@@ -146,6 +158,28 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
146
158
$ report ->getNumExecutableLines ()
147
159
);
148
160
161
+ $ branches = \sprintf (
162
+ ' Branches: %6s (%d/%d) ' ,
163
+ Util::percent (
164
+ $ report ->getNumTestedBranches (),
165
+ $ report ->getNumBranches (),
166
+ true
167
+ ),
168
+ $ report ->getNumTestedBranches (),
169
+ $ report ->getNumBranches ()
170
+ );
171
+
172
+ $ paths = \sprintf (
173
+ ' Paths: %6s (%d/%d) ' ,
174
+ Util::percent (
175
+ $ report ->getNumTestedPaths (),
176
+ $ report ->getNumPaths (),
177
+ true
178
+ ),
179
+ $ report ->getNumTestedPaths (),
180
+ $ report ->getNumPaths ()
181
+ );
182
+
149
183
$ padding = \max (\array_map ('strlen ' , [$ classes , $ methods , $ lines ]));
150
184
151
185
if ($ this ->showOnlySummary ) {
@@ -166,6 +200,8 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
166
200
$ output .= $ this ->format ($ colors ['classes ' ], $ padding , $ classes );
167
201
$ output .= $ this ->format ($ colors ['methods ' ], $ padding , $ methods );
168
202
$ output .= $ this ->format ($ colors ['lines ' ], $ padding , $ lines );
203
+ $ output .= $ this ->format ($ colors ['branches ' ], $ padding , $ branches );
204
+ $ output .= $ this ->format ($ colors ['paths ' ], $ padding , $ paths );
169
205
170
206
if ($ this ->showOnlySummary ) {
171
207
return $ output . \PHP_EOL ;
0 commit comments