1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-26 03:26:38 +01: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

@@ -943,13 +943,10 @@ class ZipEntry
*/
public function setEncryptionMethod(?int $encryptionMethod): self
{
if ($encryptionMethod === null) {
$encryptionMethod = ZipEncryptionMethod::NONE;
}
$method = $encryptionMethod ?? ZipEncryptionMethod::NONE;
$encryptionMethod = (int) $encryptionMethod;
ZipEncryptionMethod::checkSupport($encryptionMethod);
$this->encryptionMethod = $encryptionMethod;
ZipEncryptionMethod::checkSupport($method);
$this->encryptionMethod = $method;
$this->setEncrypted($this->encryptionMethod !== ZipEncryptionMethod::NONE);
$this->extractVersion = self::UNKNOWN;