Skip to content

Commit

Permalink
Merge pull request #1750 from tinect/style/ZipArchiveCode
Browse files Browse the repository at this point in the history
style: [ZipArchive] update method usages to PHP 8.0
  • Loading branch information
frankdejonge authored Feb 4, 2024
2 parents afafdfc + fc217ac commit 57c8534
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ZipArchive/ZipArchiveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function deleteDirectory(string $path): void

$itemPath = $stats['name'];

if (strpos($itemPath, $prefixedPath) !== 0) {
if (!str_starts_with($itemPath, $prefixedPath)) {
continue;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public function listContents(string $path, bool $deep): iterable

if (
$location === $itemPath
|| ($deep && $location !== '' && strpos($itemPath, $location) !== 0)
|| ($deep && $location !== '' && !str_starts_with($itemPath, $location))
|| ($deep === false && ! $this->isAtRootDirectory($location, $itemPath))
) {
continue;
Expand Down Expand Up @@ -412,7 +412,7 @@ private function ensureDirectoryExists(string $dirname, Config $config): void

private function isDirectoryPath(string $path): bool
{
return substr($path, -1) === '/';
return str_ends_with($path, '/');
}

private function isAtRootDirectory(string $directoryRoot, string $path): bool
Expand Down

0 comments on commit 57c8534

Please sign in to comment.