Skip to content

Commit 8fdb7ff

Browse files
Remove deprecated functionality
1 parent bf33b01 commit 8fdb7ff

File tree

4 files changed

+1
-73
lines changed

4 files changed

+1
-73
lines changed

.psalm/baseline.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@
5555
</UndefinedConstant>
5656
</file>
5757
<file src="src/Filter.php">
58-
<ArgumentTypeCoercion>
59-
<code>$directory</code>
60-
<code>$directory</code>
61-
</ArgumentTypeCoercion>
62-
<DeprecatedMethod>
63-
<code>excludeFile</code>
64-
</DeprecatedMethod>
6558
<InvalidDocblockParamName>
6659
<code>$files</code>
6760
</InvalidDocblockParamName>

ChangeLog-11.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
66

77
### Removed
88

9+
* The `SebastianBergmann\CodeCoverage\Filter::includeDirectory()`, `SebastianBergmann\CodeCoverage\Filter::excludeDirectory()`, and `SebastianBergmann\CodeCoverage\Filter::excludeFile()` methods have been removed
910
* This component now requires PHP-Parser 5
1011
* This component is no longer supported on PHP 8.1
1112

src/Filter.php

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use function realpath;
1515
use function str_contains;
1616
use function str_starts_with;
17-
use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
1817

1918
final class Filter
2019
{
@@ -28,16 +27,6 @@ final class Filter
2827
*/
2928
private array $isFileCache = [];
3029

31-
/**
32-
* @deprecated
33-
*/
34-
public function includeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void
35-
{
36-
foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) {
37-
$this->includeFile($file);
38-
}
39-
}
40-
4130
/**
4231
* @psalm-param list<string> $files
4332
*/
@@ -59,30 +48,6 @@ public function includeFile(string $filename): void
5948
$this->files[$filename] = true;
6049
}
6150

62-
/**
63-
* @deprecated
64-
*/
65-
public function excludeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void
66-
{
67-
foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) {
68-
$this->excludeFile($file);
69-
}
70-
}
71-
72-
/**
73-
* @deprecated
74-
*/
75-
public function excludeFile(string $filename): void
76-
{
77-
$filename = realpath($filename);
78-
79-
if (!$filename || !isset($this->files[$filename])) {
80-
return;
81-
}
82-
83-
unset($this->files[$filename]);
84-
}
85-
8651
public function isFile(string $filename): bool
8752
{
8853
if (isset($this->isFileCache[$filename])) {

tests/tests/FilterTest.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,6 @@ public function testMultipleFilesCanBeAdded(): void
5757
$this->assertSame($files, $this->filter->files());
5858
}
5959

60-
public function testDirectoryCanBeAdded(): void
61-
{
62-
$this->filter->includeDirectory(__DIR__ . '/../_files/filter');
63-
64-
$this->assertSame(
65-
[
66-
realpath(__DIR__ . '/../_files/filter/a.php'),
67-
realpath(__DIR__ . '/../_files/filter/b.php'),
68-
],
69-
$this->filter->files()
70-
);
71-
}
72-
73-
public function testSingleFileCanBeRemoved(): void
74-
{
75-
$this->filter->includeFile(realpath(__DIR__ . '/../_files/filter/a.php'));
76-
$this->filter->excludeFile(realpath(__DIR__ . '/../_files/filter/a.php'));
77-
78-
$this->assertTrue($this->filter->isEmpty());
79-
$this->assertSame([], $this->filter->files());
80-
}
81-
82-
public function testDirectoryCanBeRemoved(): void
83-
{
84-
$this->filter->includeDirectory(__DIR__ . '/../_files/filter');
85-
$this->filter->excludeDirectory(__DIR__ . '/../_files/filter');
86-
87-
$this->assertTrue($this->filter->isEmpty());
88-
$this->assertSame([], $this->filter->files());
89-
}
90-
9160
public function testDeterminesWhetherStringContainsNameOfRealFileThatExists(): void
9261
{
9362
$this->assertFalse($this->filter->isFile('vfs://root/a/path'));

0 commit comments

Comments
 (0)