@@ -91,9 +91,10 @@ public function __construct($name, PHP_CodeCoverage_Report_HTML_Node $parent = N
91
91
*/
92
92
public function getTestedClassesPercent ()
93
93
{
94
- return $ this -> calculatePercent (
94
+ return PHP_CodeCoverage_Util:: percent (
95
95
$ this ->getNumTestedClasses (),
96
- $ this ->getNumClasses ()
96
+ $ this ->getNumClasses (),
97
+ TRUE
97
98
);
98
99
}
99
100
@@ -104,9 +105,10 @@ public function getTestedClassesPercent()
104
105
*/
105
106
public function getTestedMethodsPercent ()
106
107
{
107
- return $ this -> calculatePercent (
108
+ return PHP_CodeCoverage_Util:: percent (
108
109
$ this ->getNumTestedMethods (),
109
- $ this ->getNumMethods ()
110
+ $ this ->getNumMethods (),
111
+ TRUE
110
112
);
111
113
}
112
114
@@ -117,9 +119,10 @@ public function getTestedMethodsPercent()
117
119
*/
118
120
public function getLineExecutedPercent ()
119
121
{
120
- return $ this -> calculatePercent (
122
+ return PHP_CodeCoverage_Util:: percent (
121
123
$ this ->getNumExecutedLines (),
122
- $ this ->getNumExecutableLines ()
124
+ $ this ->getNumExecutableLines (),
125
+ TRUE
123
126
);
124
127
}
125
128
@@ -248,27 +251,6 @@ public function getPath()
248
251
return $ this ->cache ['path ' ];
249
252
}
250
253
251
- /**
252
- * Calculates a percentage value.
253
- *
254
- * @param integer $a
255
- * @param integer $b
256
- * @return float ($a / $b) * 100
257
- */
258
- protected function calculatePercent ($ a , $ b )
259
- {
260
- if ($ b > 0 ) {
261
- $ percent = ($ a / $ b ) * 100 ;
262
- } else {
263
- $ percent = 100 ;
264
- }
265
-
266
- return sprintf (
267
- '%01.2F ' ,
268
- $ percent
269
- );
270
- }
271
-
272
254
protected function doRenderItemObject (PHP_CodeCoverage_Report_HTML_Node $ item , $ lowUpperBound , $ highLowerBound , $ link = NULL , $ itemClass = 'coverItem ' )
273
255
{
274
256
return $ this ->doRenderItem (
0 commit comments