Skip to content

Commit 9011bf6

Browse files
fabpotsebastianbergmann
authored andcommitted
Fix the difference between adding files or a single file to the filter
* Add the check flag to check the existence of each added file * Use the addFile* method to add the file to reference the realpath of the file
1 parent 4ec92b6 commit 9011bf6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

PHP/CodeCoverage/Filter.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@ public function addFileToBlacklist($filename, $group = 'DEFAULT', $check = TRUE)
145145
*
146146
* @param array $files
147147
* @param string $group
148+
* @param boolean $check
148149
*/
149-
public function addFilesToBlacklist(array $files, $group = 'DEFAULT')
150+
public function addFilesToBlacklist(array $files, $group = 'DEFAULT', $check = TRUE)
150151
{
151152
foreach ($files as $file) {
152-
$this->blacklistedFiles[$group][$file] = TRUE;
153+
$this->addFileToBlacklist($file, $group, $check);
153154
}
154155
}
155156

@@ -238,11 +239,12 @@ public function addFileToWhitelist($filename, $check = TRUE)
238239
* Adds files to the whitelist.
239240
*
240241
* @param array $files
242+
* @param boolean $check
241243
*/
242-
public function addFilesToWhitelist(array $files)
244+
public function addFilesToWhitelist(array $files, $check = TRUE)
243245
{
244246
foreach ($files as $file) {
245-
$this->whitelistedFiles[$file] = TRUE;
247+
$this->addFileToWhitelist($file, TRUE);
246248
}
247249
}
248250

0 commit comments

Comments
 (0)