Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ne-Lexa committed Jan 9, 2020
2 parents 3b76979 + f426871 commit 25d5ddc
Show file tree
Hide file tree
Showing 131 changed files with 14,708 additions and 7,944 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
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
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
110 changes: 110 additions & 0 deletions .phpstorm.meta.php
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'));
}
69 changes: 57 additions & 12 deletions .travis.yml
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
42 changes: 0 additions & 42 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 25d5ddc

Please sign in to comment.