1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-12 22:04:29 +02:00

added static analysis

This commit is contained in:
Ne-Lexa
2021-02-23 19:44:48 +03:00
parent a85288d34b
commit 00dd097b2d
21 changed files with 84 additions and 86 deletions

View File

@@ -370,13 +370,10 @@ class ZipReader
if ($unicodePathExtraField !== null && $unicodePathExtraField->getCrc32() === crc32($entryName)) {
$unicodePath = $unicodePathExtraField->getUnicodeValue();
if ($unicodePath !== null) {
if ($unicodePath !== '') {
$unicodePath = str_replace('\\', '/', $unicodePath);
if (
$unicodePath !== ''
&& substr_count($entryName, '/') === substr_count($unicodePath, '/')
) {
if (substr_count($entryName, '/') === substr_count($unicodePath, '/')) {
$entryName = $unicodePath;
}
}
@@ -869,6 +866,9 @@ class ZipReader
return \PHP_INT_SIZE === 8; // true for 64bit system
}
/**
* @psalm-suppress InvalidPropertyAssignmentValue
*/
public function close(): void
{
if (\is_resource($this->inStream)) {