diff --git a/src/ZipArchive/ZipArchiveAdapter.php b/src/ZipArchive/ZipArchiveAdapter.php index 58586deea..9d2e29ac1 100644 --- a/src/ZipArchive/ZipArchiveAdapter.php +++ b/src/ZipArchive/ZipArchiveAdapter.php @@ -30,7 +30,6 @@ use function fopen; use function rewind; use function stream_copy_to_stream; -use function stream_with_contents; final class ZipArchiveAdapter implements FilesystemAdapter { @@ -161,7 +160,7 @@ public function deleteDirectory(string $path): void $itemPath = $stats['name']; - if ($prefixedPath === $itemPath || strpos($itemPath, $prefixedPath) !== 0) { + if (strpos($itemPath, $prefixedPath) !== 0) { continue; } diff --git a/src/ZipArchive/ZipArchiveAdapterTest.php b/src/ZipArchive/ZipArchiveAdapterTest.php index 4b64da78f..2dafd550a 100644 --- a/src/ZipArchive/ZipArchiveAdapterTest.php +++ b/src/ZipArchive/ZipArchiveAdapterTest.php @@ -136,7 +136,7 @@ public function deleting_a_directory(): void $this->adapter()->deleteDirectory('one'); $items = iterator_to_array($this->adapter()->listContents('', true)); - $this->assertCount(4, $items); + $this->assertCount(3, $items); } /**