| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 1 | public function __invoke(array $bitmap, $width, $height) |
|
| 17 | { |
||
| 18 | 1 | $total = 0; |
|
| 19 | 1 | $different = 0; |
|
| 20 | |||
| 21 | 1 | for ($y = 0; $y < $height; $y++) { |
|
| 22 | 1 | for ($x = 0; $x < $width; $x++) { |
|
| 23 | 1 | $total++; |
|
| 24 | |||
| 25 | 1 | if ($bitmap[$y][$x] > 0) { |
|
| 26 | 1 | $different++; |
|
| 27 | 1 | } |
|
| 28 | 1 | } |
|
| 29 | 1 | } |
|
| 30 | |||
| 31 | 1 | return (float) (($different / $total) * 100); |
|
| 32 | } |
||
| 33 | } |
||
| 34 |