1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-08-29 09:50:40 +02:00

fix deprecation use

This commit is contained in:
Ne-Lexa
2020-01-09 17:33:02 +03:00
parent 971747f5e7
commit fd1fbf3ad6
3 changed files with 9 additions and 9 deletions

View File

@@ -1353,14 +1353,13 @@ class ZipFile implements ZipFileInterface
* @see ZipCompressionLevel::FAST
* @see ZipCompressionLevel::MAXIMUM
*/
public function setCompressionLevel($compressionLevel = self::LEVEL_DEFAULT_COMPRESSION)
public function setCompressionLevel($compressionLevel = ZipCompressionLevel::NORMAL)
{
$this->matcher()->all()->invoke(
/** @param string $entry */
function ($entry) use ($compressionLevel) {
$this->setCompressionLevelEntry($entry, $compressionLevel);
}
);
$compressionLevel = (int) $compressionLevel;
foreach ($this->zipContainer->getEntries() as $entry) {
$entry->setCompressionLevel($compressionLevel);
}
return $this;
}

View File

@@ -586,7 +586,7 @@ interface ZipFileInterface extends \Countable, \ArrayAccess, \Iterator
* @see ZipCompressionLevel::FAST
* @see ZipCompressionLevel::MAXIMUM
*/
public function setCompressionLevel($compressionLevel = self::LEVEL_DEFAULT_COMPRESSION);
public function setCompressionLevel($compressionLevel = ZipCompressionLevel::NORMAL);
/**
* @param string $entryName