@@ -70,37 +70,6 @@ class PHP_CodeCoverage_Filter
7070 */
7171 private $ whitelistedFiles = array ();
7272
73- /**
74- * @var boolean
75- */
76- private $ blacklistPrefilled = false ;
77-
78- /**
79- * A list of classes which are always blacklisted
80- *
81- * @var array
82- */
83- public static $ blacklistClassNames = array (
84- 'File_Iterator ' => 1 ,
85- 'PHP_CodeCoverage ' => 1 ,
86- 'PHP_Invoker ' => 1 ,
87- 'PHP_Timer ' => 1 ,
88- 'PHP_Token ' => 1 ,
89- 'PHPUnit_Framework_TestCase ' => 2 ,
90- 'PHPUnit_Extensions_Database_TestCase ' => 2 ,
91- 'PHPUnit_Framework_MockObject_Generator ' => 2 ,
92- 'PHPUnit_Extensions_SeleniumTestCase ' => 2 ,
93- 'PHPUnit_Extensions_Story_TestCase ' => 2 ,
94- 'Text_Template ' => 1 ,
95- 'Symfony\Component\Yaml\Yaml ' => 1 ,
96- 'SebastianBergmann\Diff\Diff ' => 1 ,
97- 'SebastianBergmann\Environment\Runtime ' => 1 ,
98- 'SebastianBergmann\Comparator\Comparator ' => 1 ,
99- 'SebastianBergmann\Exporter\Exporter ' => 1 ,
100- 'SebastianBergmann\Version ' => 1 ,
101- 'Composer\Autoload\ClassLoader ' => 1
102- );
103-
10473 /**
10574 * Adds a directory to the blacklist (recursively).
10675 *
@@ -279,10 +248,6 @@ public function isFiltered($filename)
279248 return !isset ($ this ->whitelistedFiles [$ filename ]);
280249 }
281250
282- if (!$ this ->blacklistPrefilled ) {
283- $ this ->prefillBlacklist ();
284- }
285-
286251 return isset ($ this ->blacklistedFiles [$ filename ]);
287252 }
288253
@@ -317,43 +282,6 @@ public function hasWhitelist()
317282 return !empty ($ this ->whitelistedFiles );
318283 }
319284
320- /**
321- * @since Method available since Release 1.2.3
322- */
323- private function prefillBlacklist ()
324- {
325- if (defined ('__PHPUNIT_PHAR__ ' )) {
326- $ this ->addFileToBlacklist (__PHPUNIT_PHAR__ );
327- }
328-
329- foreach (self ::$ blacklistClassNames as $ className => $ parent ) {
330- $ this ->addDirectoryContainingClassToBlacklist ($ className , $ parent );
331- }
332-
333- $ this ->blacklistPrefilled = true ;
334- }
335-
336- /**
337- * @param string $className
338- * @param integer $parent
339- * @since Method available since Release 1.2.3
340- */
341- private function addDirectoryContainingClassToBlacklist ($ className , $ parent = 1 )
342- {
343- if (!class_exists ($ className )) {
344- return ;
345- }
346-
347- $ reflector = new ReflectionClass ($ className );
348- $ directory = $ reflector ->getFileName ();
349-
350- for ($ i = 0 ; $ i < $ parent ; $ i ++) {
351- $ directory = dirname ($ directory );
352- }
353-
354- $ this ->addDirectoryToBlacklist ($ directory );
355- }
356-
357285 /**
358286 * Returns the blacklisted files.
359287 *
0 commit comments