Fix conformance score calculcation (#313)
This commit is contained in:
parent
3e45b1f486
commit
f12ea0ab58
1 changed files with 19 additions and 10 deletions
|
|
@ -68,17 +68,20 @@ require_once dirname(__DIR__, 2).'/vendor/autoload.php';
|
|||
continue;
|
||||
}
|
||||
|
||||
++$total;
|
||||
|
||||
foreach ($checks as $check) {
|
||||
if ('FAILURE' === ($check['status'] ?? null)) {
|
||||
$failures[] = $file->getRelativePath();
|
||||
|
||||
continue 2;
|
||||
switch ($check['status'] ?? null) {
|
||||
case 'FAILURE':
|
||||
$failures[] = $file->getRelativePath();
|
||||
break;
|
||||
case 'SUCCESS':
|
||||
++$passed;
|
||||
break;
|
||||
default:
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
++$passed;
|
||||
++$total;
|
||||
}
|
||||
}
|
||||
|
||||
$pct = $total > 0 ? (int) round($passed / $total * 100) : 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue