Skip to content

Commit 16be864

Browse files
Merge branch '1.2'
2 parents 7fee9ef + dff2703 commit 16be864

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

PHP/CodeCoverage.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ class PHP_CodeCoverage
8181
*/
8282
protected $mapTestClassNameToCoveredClassName = FALSE;
8383

84+
/**
85+
* @var boolean
86+
*/
87+
protected $addUncoveredFilesFromWhitelist = TRUE;
88+
8489
/**
8590
* @var boolean
8691
*/
@@ -167,7 +172,9 @@ public function filter()
167172
*/
168173
public function getData()
169174
{
170-
$this->processUncoveredFilesFromWhitelist();
175+
if ($this->addUncoveredFilesFromWhitelist) {
176+
$this->addUncoveredFilesFromWhitelist();
177+
}
171178

172179
// We need to apply the blacklist filter a second time
173180
// when no whitelist is used.
@@ -381,6 +388,21 @@ public function setMapTestClassNameToCoveredClassName($flag)
381388
$this->mapTestClassNameToCoveredClassName = $flag;
382389
}
383390

391+
/**
392+
* @param boolean $flag
393+
* @throws PHP_CodeCoverage_Exception
394+
*/
395+
public function setAddUncoveredFilesFromWhitelist($flag)
396+
{
397+
if (!is_bool($flag)) {
398+
throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory(
399+
1, 'boolean'
400+
);
401+
}
402+
403+
$this->addUncoveredFilesFromWhitelist = $flag;
404+
}
405+
384406
/**
385407
* @param boolean $flag
386408
* @throws PHP_CodeCoverage_Exception
@@ -476,7 +498,7 @@ protected function initializeFilesThatAreSeenTheFirstTime($data)
476498
/**
477499
* Processes whitelisted files that are not covered.
478500
*/
479-
protected function processUncoveredFilesFromWhitelist()
501+
protected function addUncoveredFilesFromWhitelist()
480502
{
481503
$data = array();
482504
$uncoveredFiles = array_diff(

0 commit comments

Comments
 (0)