@@ -433,22 +433,40 @@ public function setPromoteGlobals($flag)
433
433
}
434
434
435
435
/**
436
- * Filters sourcecode files from PHP_CodeCoverage, Text_Template, and
437
- * File_Iterator.
436
+ * Filters sourcecode files from PHP_CodeCoverage, PHP_TokenStream,
437
+ * Text_Template, and File_Iterator.
438
438
*
439
439
* @param array $data
440
440
*/
441
441
protected function applySelfFilter(&$data)
442
442
{
443
443
foreach (array_keys($data) as $filename) {
444
- if (!$this->filter->isFile($filename) ||
445
- (!defined('PHP_CODECOVERAGE_TESTSUITE') &&
446
- strpos($filename, dirname(__FILE__)) === 0) ||
447
- substr($filename, -17) == 'File/Iterator.php' ||
448
- substr($filename, -25) == 'File/Iterator/Factory.php' ||
449
- substr($filename, -17) == 'Text/Template.php' ||
450
- substr($filename, -13) == 'PHP/Token.php' ||
451
- substr($filename, -20) == 'PHP/Token/Stream.php') {
444
+ if (!$this->filter->isFile($filename)) {
445
+ unset($data[$filename]);
446
+ continue;
447
+ }
448
+
449
+ if (!defined('PHP_CODECOVERAGE_TESTSUITE') &&
450
+ strpos($filename, dirname(__FILE__)) === 0) {
451
+ unset($data[$filename]);
452
+ continue;
453
+ }
454
+
455
+ if (!defined('FILE_ITERATOR_TESTSUITE') &&
456
+ (substr($filename, -17) == 'File/Iterator.php' ||
457
+ substr($filename, -25) == 'File/Iterator/Factory.php')) {
458
+ unset($data[$filename]);
459
+ continue;
460
+ }
461
+
462
+ if (!defined('PHP_TOKENSTREAM_TESTSUITE') &&
463
+ (substr($filename, -13) == 'PHP/Token.php' ||
464
+ substr($filename, -20) == 'PHP/Token/Stream.php')) {
465
+ unset($data[$filename]);
466
+ continue;
467
+ }
468
+
469
+ if (substr($filename, -17) == 'Text/Template.php') {
452
470
unset($data[$filename]);
453
471
}
454
472
}
0 commit comments