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:
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user