@@ -65,7 +65,7 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string
6565
6666 foreach ($ classes as $ className => $ class ) {
6767 foreach ($ class ['methods ' ] as $ methodName => $ method ) {
68- $ crapLoad = $ this ->getCrapLoad ($ method ['crap ' ], $ method ['ccn ' ], $ method ['coverage ' ]);
68+ $ crapLoad = $ this ->getCrapLoad (( float ) $ method ['crap ' ], $ method ['ccn ' ], $ method ['coverage ' ]);
6969
7070 $ fullCrap += $ method ['crap ' ];
7171 $ fullCrapLoad += $ crapLoad ;
@@ -86,7 +86,7 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string
8686 $ methodNode ->appendChild ($ document ->createElement ('methodName ' , $ methodName ));
8787 $ methodNode ->appendChild ($ document ->createElement ('methodSignature ' , \htmlspecialchars ($ method ['signature ' ])));
8888 $ methodNode ->appendChild ($ document ->createElement ('fullMethod ' , \htmlspecialchars ($ method ['signature ' ])));
89- $ methodNode ->appendChild ($ document ->createElement ('crap ' , (string ) $ this ->roundValue ($ method ['crap ' ])));
89+ $ methodNode ->appendChild ($ document ->createElement ('crap ' , (string ) $ this ->roundValue (( float ) $ method ['crap ' ])));
9090 $ methodNode ->appendChild ($ document ->createElement ('complexity ' , (string ) $ method ['ccn ' ]));
9191 $ methodNode ->appendChild ($ document ->createElement ('coverage ' , (string ) $ this ->roundValue ($ method ['coverage ' ])));
9292 $ methodNode ->appendChild ($ document ->createElement ('crapLoad ' , (string ) \round ($ crapLoad )));
@@ -133,12 +133,7 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string
133133 return $ buffer ;
134134 }
135135
136- /**
137- * @param float $crapValue
138- * @param int $cyclomaticComplexity
139- * @param float $coveragePercent
140- */
141- private function getCrapLoad ($ crapValue , $ cyclomaticComplexity , $ coveragePercent ): float
136+ private function getCrapLoad (float $ crapValue , int $ cyclomaticComplexity , float $ coveragePercent ): float
142137 {
143138 $ crapLoad = 0 ;
144139
@@ -150,10 +145,7 @@ private function getCrapLoad($crapValue, $cyclomaticComplexity, $coveragePercent
150145 return $ crapLoad ;
151146 }
152147
153- /**
154- * @param float $value
155- */
156- private function roundValue ($ value ): float
148+ private function roundValue (float $ value ): float
157149 {
158150 return \round ($ value , 2 );
159151 }
0 commit comments