1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-08-29 17:59:55 +02:00

Rename methods removePassword*() to disableEncryption*()

This commit is contained in:
Ne-Lexa
2017-11-14 14:47:46 +03:00
parent e62e51efb5
commit d32b000855
8 changed files with 45 additions and 38 deletions

View File

@@ -395,7 +395,7 @@ abstract class ZipAbstractEntry implements ZipEntry
*
* @return ZipEntry
*/
public function clearEncryption()
public function disableEncryption()
{
$this->setEncrypted(false);
$headerId = WinZipAesEntryExtraField::getHeaderId();
@@ -722,7 +722,7 @@ abstract class ZipAbstractEntry implements ZipEntry
if (!empty($this->password)) {
$this->setEncrypted(true);
} else {
$this->clearEncryption();
$this->disableEncryption();
}
return $this;
}

View File

@@ -252,7 +252,7 @@ interface ZipEntry
*
* @return ZipEntry
*/
public function clearEncryption();
public function disableEncryption();
/**
* Returns the compression method for this entry.

View File

@@ -162,6 +162,9 @@ class ZipModel implements \Countable
$this->matcher()->all()->setPassword(null);
}
/**
* @param string|ZipEntry $entryName
*/
public function removePasswordEntry($entryName)
{
$this->matcher()->add($entryName)->setPassword(null);

View File

@@ -1080,7 +1080,7 @@ class ZipFile implements ZipFileInterface
}
/**
* Set password for zip archive
* Sets a new password for all files in the archive.
*
* @param string $password
* @param int|null $encryptionMethod Encryption method
@@ -1100,8 +1100,10 @@ class ZipFile implements ZipFileInterface
}
/**
* Sets a new password of an entry defined by its name.
*
* @param string $entryName
* @param string|null $password
* @param string $password
* @param int|null $encryptionMethod
* @return ZipFileInterface
* @throws ZipException
@@ -1120,29 +1122,29 @@ class ZipFile implements ZipFileInterface
/**
* Remove password for all entries for update.
* @return ZipFileInterface
* @deprecated using ZipFileInterface::removePassword()
* @deprecated using ZipFileInterface::disableEncryption()
*/
public function withoutPassword()
{
return $this->removePassword();
return $this->disableEncryption();
}
/**
* Remove password for all entries for update.
* Disable encryption for all entries that are already in the archive.
* @return ZipFileInterface
*/
public function removePassword()
public function disableEncryption()
{
$this->zipModel->removePassword();
return $this;
}
/**
* Remove password for concrete entry.
* Disable encryption of an entry defined by its name.
* @param string $entryName
* @return ZipFileInterface
*/
public function removePasswordEntry($entryName)
public function disableEncryptionEntry($entryName)
{
$this->zipModel->removePasswordEntry($entryName);
return $this;

View File

@@ -513,7 +513,7 @@ interface ZipFileInterface extends \Countable, \ArrayAccess, \Iterator
public function withNewPassword($password, $encryptionMethod = self::ENCRYPTION_METHOD_WINZIP_AES_256);
/**
* Set password for zip archive
* Sets a new password for all files in the archive.
*
* @param string $password
* @param int|null $encryptionMethod Encryption method
@@ -522,32 +522,34 @@ interface ZipFileInterface extends \Countable, \ArrayAccess, \Iterator
public function setPassword($password, $encryptionMethod = self::ENCRYPTION_METHOD_WINZIP_AES_256);
/**
* Sets a new password of an entry defined by its name.
*
* @param string $entryName
* @param string $password
* @param int|null $encryptionMethod
* @return mixed
* @return ZipFileInterface
*/
public function setPasswordEntry($entryName, $password, $encryptionMethod = null);
/**
* Remove password for all entries for update.
* @return ZipFileInterface
* @deprecated using ZipFileInterface::removePassword()
* @deprecated using ZipFileInterface::disableEncryption()
*/
public function withoutPassword();
/**
* Remove password for all entries for update.
* Disable encryption for all entries that are already in the archive.
* @return ZipFileInterface
*/
public function removePassword();
public function disableEncryption();
/**
* Remove password for concrete entry.
* Disable encryption of an entry defined by its name.
* @param string $entryName
* @return ZipFileInterface
*/
public function removePasswordEntry($entryName);
public function disableEncryptionEntry($entryName);
/**
* Undo all changes done in the archive