-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
131 changed files
with
14,708 additions
and
7,944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.gitattributes export-ignore | ||
.github export-ignore | ||
.gitignore export-ignore | ||
.php_cs export-ignore | ||
.travis.yml export-ignore | ||
bootstrap.php export-ignore | ||
phpunit.xml export-ignore | ||
tests export-ignore | ||
tests export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?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")); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setCompressionMethod(), 0, argumentsSet("compression_methods")); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setMethod(), 0, 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")); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setCompressionLevel(), 0, 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")); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setEncryptionMethod(), 0, argumentsSet("encryption_methods")); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setPassword(), 1, 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\ZipFile::outputAsResponse(), 2, argumentsSet("zip_mime_types")); | ||
expectedArguments(\PhpZip\ZipFile::outputAsResponse(), 3, argumentsSet("bool")); | ||
|
||
registerArgumentsSet( | ||
'dos_charset', | ||
\PhpZip\Constants\DosCodePage::CP_LATIN_US, | ||
\PhpZip\Constants\DosCodePage::CP_GREEK, | ||
\PhpZip\Constants\DosCodePage::CP_BALT_RIM, | ||
\PhpZip\Constants\DosCodePage::CP_LATIN1, | ||
\PhpZip\Constants\DosCodePage::CP_LATIN2, | ||
\PhpZip\Constants\DosCodePage::CP_CYRILLIC, | ||
\PhpZip\Constants\DosCodePage::CP_TURKISH, | ||
\PhpZip\Constants\DosCodePage::CP_PORTUGUESE, | ||
\PhpZip\Constants\DosCodePage::CP_ICELANDIC, | ||
\PhpZip\Constants\DosCodePage::CP_HEBREW, | ||
\PhpZip\Constants\DosCodePage::CP_CANADA, | ||
\PhpZip\Constants\DosCodePage::CP_ARABIC, | ||
\PhpZip\Constants\DosCodePage::CP_NORDIC, | ||
\PhpZip\Constants\DosCodePage::CP_CYRILLIC_RUSSIAN, | ||
\PhpZip\Constants\DosCodePage::CP_GREEK2, | ||
\PhpZip\Constants\DosCodePage::CP_THAI, | ||
); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setCharset(), 0, argumentsSet('dos_charset')); | ||
expectedArguments(\PhpZip\Constants\DosCodePage::toUTF8(), 1, argumentsSet('dos_charset')); | ||
expectedArguments(\PhpZip\Constants\DosCodePage::fromUTF8(), 1, argumentsSet('dos_charset')); | ||
|
||
registerArgumentsSet( | ||
"zip_os", | ||
\PhpZip\Constants\ZipPlatform::OS_UNIX, | ||
\PhpZip\Constants\ZipPlatform::OS_DOS, | ||
\PhpZip\Constants\ZipPlatform::OS_MAC_OSX, | ||
); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setCreatedOS(), 0, argumentsSet('zip_os')); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setExtractedOS(), 0, argumentsSet('zip_os')); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setPlatform(), 0, argumentsSet('zip_os')); | ||
|
||
registerArgumentsSet( | ||
"zip_gpbf", | ||
\PhpZip\Constants\GeneralPurposeBitFlag::ENCRYPTION | | ||
\PhpZip\Constants\GeneralPurposeBitFlag::DATA_DESCRIPTOR | | ||
\PhpZip\Constants\GeneralPurposeBitFlag::COMPRESSION_FLAG1 | | ||
\PhpZip\Constants\GeneralPurposeBitFlag::COMPRESSION_FLAG2 | | ||
\PhpZip\Constants\GeneralPurposeBitFlag::UTF8 | ||
); | ||
expectedArguments(\PhpZip\Model\ZipEntry::setGeneralPurposeBitFlags(), 0, argumentsSet('zip_gpbf')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,67 @@ | ||
dist: trusty | ||
|
||
language: php | ||
php: | ||
- '5.5' | ||
- '5.6' | ||
- '7.0' | ||
- '7.1' | ||
- '7.2' | ||
- '7.3' | ||
- '7.4' | ||
|
||
env: | ||
global: | ||
- ZIPALIGN_INSTALL=false | ||
- COVERAGE=false | ||
- PHPUNIT_FLAGS="-v -c phpunit.xml --testsuite only_fast_tests" | ||
|
||
matrix: | ||
include: | ||
- php: 5.5 | ||
os: linux | ||
dist: trusty | ||
|
||
- php: 5.6 | ||
os: linux | ||
dist: xenial | ||
env: ZIPALIGN_INSTALL=true | ||
|
||
- php: 7.0 | ||
os: linux | ||
dist: xenial | ||
env: ZIPALIGN_INSTALL=true | ||
|
||
- php: 7.1 | ||
os: linux | ||
dist: xenial | ||
env: ZIPALIGN_INSTALL=true | ||
|
||
- php: 7.2 | ||
os: linux | ||
dist: xenial | ||
env: ZIPALIGN_INSTALL=true | ||
|
||
- php: 7.3 | ||
os: linux | ||
dist: xenial | ||
env: ZIPALIGN_INSTALL=true | ||
|
||
- php: 7.4 | ||
os: linux | ||
dist: bionic | ||
env: COVERAGE=true ZIPALIGN_INSTALL=true PHPUNIT_FLAGS="-v -c phpunit.xml --testsuite only_fast_tests --coverage-clover=coverage.clover" | ||
|
||
before_install: | ||
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi | ||
|
||
install: | ||
- travis_retry composer self-update && composer --version | ||
- travis_retry composer install --no-interaction | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- unzip | ||
- p7zip-full | ||
|
||
before_script: | ||
- sudo apt-get install p7zip-full | ||
- if [[ $ZIPALIGN_INSTALL = true ]]; then sudo apt-get install -y zipalign; fi | ||
|
||
script: | ||
- composer validate --no-check-lock | ||
- vendor/bin/phpunit -v -c phpunit.xml | ||
- vendor/bin/phpunit ${PHPUNIT_FLAGS} | ||
|
||
after_success: | ||
- if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi | ||
- if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.