mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Refactoring loops in CodeCoverageManager
This commit is contained in:
parent
645807211b
commit
5a88aaf909
1 changed files with 6 additions and 9 deletions
|
@ -105,7 +105,6 @@ class CodeCoverageManager {
|
|||
}
|
||||
$manager->setParams($reporter);
|
||||
$manager->testCaseFile = $testCaseFile;
|
||||
CodeCoverageManager::start();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -180,11 +179,8 @@ class CodeCoverageManager {
|
|||
$dump = xdebug_get_code_coverage();
|
||||
$coverageData = array();
|
||||
|
||||
foreach ($dump as $file => $data) {
|
||||
if ($file == $testObjectFile) {
|
||||
$coverageData = $data;
|
||||
break;
|
||||
}
|
||||
if (isset($dump[$testObjectFile])) {
|
||||
$coverageData = $dump[$testObjectFile];
|
||||
}
|
||||
|
||||
if (empty($coverageData) && $output) {
|
||||
|
@ -215,9 +211,10 @@ class CodeCoverageManager {
|
|||
}
|
||||
$dump = xdebug_get_code_coverage();
|
||||
$coverageData = array();
|
||||
foreach ($dump as $file => $data) {
|
||||
if (in_array($file, $testObjectFiles)) {
|
||||
$coverageData[$file] = $data;
|
||||
|
||||
foreach ($testObjectFiles as $file) {
|
||||
if (isset($dump[$file])) {
|
||||
$coverageData[$file] = $dump[$file];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue