@@ -35,42 +35,6 @@ class PHP_CodeCoverage_Filter
3535 */
3636 private $ whitelistedFiles = array ();
3737
38- /**
39- * @var boolean
40- */
41- private $ blacklistPrefilled = false ;
42-
43- /**
44- * A list of classes which are always blacklisted
45- *
46- * @var array
47- */
48- public static $ blacklistClassNames = array (
49- 'File_Iterator ' => 1 ,
50- 'PHP_CodeCoverage ' => 1 ,
51- 'PHP_Invoker ' => 1 ,
52- 'PHP_Timer ' => 1 ,
53- 'PHP_Token ' => 1 ,
54- 'PHPUnit_Framework_TestCase ' => 2 ,
55- 'PHPUnit_Extensions_Database_TestCase ' => 2 ,
56- 'PHPUnit_Framework_MockObject_Generator ' => 2 ,
57- 'PHPUnit_Extensions_SeleniumTestCase ' => 2 ,
58- 'PHPUnit_Extensions_Story_TestCase ' => 2 ,
59- 'Text_Template ' => 1 ,
60- 'Symfony\Component\Yaml\Yaml ' => 1 ,
61- 'SebastianBergmann\Diff\Diff ' => 1 ,
62- 'SebastianBergmann\Environment\Runtime ' => 1 ,
63- 'SebastianBergmann\Comparator\Comparator ' => 1 ,
64- 'SebastianBergmann\Exporter\Exporter ' => 1 ,
65- 'SebastianBergmann\GlobalState\Snapshot ' => 1 ,
66- 'SebastianBergmann\RecursionContext\Context ' => 1 ,
67- 'SebastianBergmann\Version ' => 1 ,
68- 'Composer\Autoload\ClassLoader ' => 1 ,
69- 'Doctrine\Instantiator\Instantiator ' => 1 ,
70- 'phpDocumentor\Reflection\DocBlock ' => 1 ,
71- 'Prophecy\Prophet ' => 1
72- );
73-
7438 /**
7539 * Adds a directory to the blacklist (recursively).
7640 *
@@ -255,10 +219,6 @@ public function isFiltered($filename)
255219 return !isset ($ this ->whitelistedFiles [$ filename ]);
256220 }
257221
258- if (!$ this ->blacklistPrefilled ) {
259- $ this ->prefillBlacklist ();
260- }
261-
262222 return isset ($ this ->blacklistedFiles [$ filename ]);
263223 }
264224
@@ -293,43 +253,6 @@ public function hasWhitelist()
293253 return !empty ($ this ->whitelistedFiles );
294254 }
295255
296- /**
297- * @since Method available since Release 1.2.3
298- */
299- private function prefillBlacklist ()
300- {
301- if (defined ('__PHPUNIT_PHAR__ ' )) {
302- $ this ->addFileToBlacklist (__PHPUNIT_PHAR__ );
303- }
304-
305- foreach (self ::$ blacklistClassNames as $ className => $ parent ) {
306- $ this ->addDirectoryContainingClassToBlacklist ($ className , $ parent );
307- }
308-
309- $ this ->blacklistPrefilled = true ;
310- }
311-
312- /**
313- * @param string $className
314- * @param integer $parent
315- * @since Method available since Release 1.2.3
316- */
317- private function addDirectoryContainingClassToBlacklist ($ className , $ parent = 1 )
318- {
319- if (!class_exists ($ className )) {
320- return ;
321- }
322-
323- $ reflector = new ReflectionClass ($ className );
324- $ directory = $ reflector ->getFileName ();
325-
326- for ($ i = 0 ; $ i < $ parent ; $ i ++) {
327- $ directory = dirname ($ directory );
328- }
329-
330- $ this ->addDirectoryToBlacklist ($ directory );
331- }
332-
333256 /**
334257 * Returns the blacklisted files.
335258 *
0 commit comments