Skip to content

Commit

Permalink
solving problems with lack of memory, the new ZipReader and ZipWriter…
Browse files Browse the repository at this point in the history
… class, adds `.phpstorm.meta.php`

#13
#16
#27
#31
#41
  • Loading branch information
Ne-Lexa committed Dec 30, 2019
1 parent 28e2207 commit f377b88
Show file tree
Hide file tree
Showing 126 changed files with 12,786 additions and 7,800 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
.github export-ignore
.gitignore export-ignore
.travis.yml export-ignore
.php_cs export-ignore
phpunit.xml export-ignore
tests export-ignore
tests export-ignore
3 changes: 2 additions & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ $rules = [
'mute_deprecation_error' => true,
'noise_remaining_usages' => true,
'noise_remaining_usages_exclude' => [
'gzinflate',
'fclose',
'fopen',
'gzinflate',
'iconv',
'mime_content_type',
'rename',
'unlink',
Expand Down
62 changes: 62 additions & 0 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace PHPSTORM_META {

registerArgumentsSet(
"bool",
true,
false
);

registerArgumentsSet(
"compression_methods",
\PhpZip\Constants\ZipCompressionMethod::STORED,
\PhpZip\Constants\ZipCompressionMethod::DEFLATED,
\PhpZip\Constants\ZipCompressionMethod::BZIP2
);
expectedArguments(\PhpZip\ZipFile::addFile(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFromStream(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFromString(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addDir(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addDirRecursive(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFilesFromIterator(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFilesFromIterator(), 2, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFilesFromGlob(), 3, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFilesFromGlobRecursive(), 3, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFilesFromRegex(), 3, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::addFilesFromRegexRecursive(), 3, argumentsSet("compression_methods"));
expectedArguments(\PhpZip\ZipFile::setCompressionMethodEntry(), 1, argumentsSet("compression_methods"));

registerArgumentsSet(
'compression_levels',
\PhpZip\Constants\ZipCompressionLevel::MAXIMUM,
\PhpZip\Constants\ZipCompressionLevel::NORMAL,
\PhpZip\Constants\ZipCompressionLevel::FAST,
\PhpZip\Constants\ZipCompressionLevel::SUPER_FAST
);
expectedArguments(\PhpZip\ZipFile::setCompressionLevel(), 0, argumentsSet("compression_levels"));
expectedArguments(\PhpZip\ZipFile::setCompressionLevelEntry(), 1, argumentsSet("compression_levels"));

registerArgumentsSet(
'encryption_methods',
\PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_256,
\PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_192,
\PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_128,
\PhpZip\Constants\ZipEncryptionMethod::PKWARE
);
expectedArguments(\PhpZip\ZipFile::setPassword(), 1, argumentsSet("encryption_methods"));
expectedArguments(\PhpZip\ZipFile::setPasswordEntry(), 2, argumentsSet("encryption_methods"));

registerArgumentsSet(
'zip_mime_types',
null,
'application/zip',
'application/vnd.android.package-archive',
'application/java-archive'
);
expectedArguments(\PhpZip\ZipFile::outputAsAttachment(), 1, argumentsSet("zip_mime_types"));
expectedArguments(\PhpZip\ZipFile::outputAsAttachment(), 2, argumentsSet("bool"));

expectedArguments(\PhpZip\ZipFileI::outputAsResponse(), 2, argumentsSet("zip_mime_types"));
expectedArguments(\PhpZip\ZipFileI::outputAsResponse(), 3, argumentsSet("bool"));
}
42 changes: 0 additions & 42 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit f377b88

Please sign in to comment.