Skip to content

Commit 25d5ddc

Browse files
committed
Merge branch 'release/3.2.0'
2 parents 3b76979 + f426871 commit 25d5ddc

File tree

131 files changed

+14708
-7944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+14708
-7944
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.gitattributes export-ignore
22
.github export-ignore
33
.gitignore export-ignore
4+
.php_cs export-ignore
45
.travis.yml export-ignore
6+
bootstrap.php export-ignore
57
phpunit.xml export-ignore
6-
tests export-ignore
8+
tests export-ignore

.php_cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,10 @@ $rules = [
232232
'mute_deprecation_error' => true,
233233
'noise_remaining_usages' => true,
234234
'noise_remaining_usages_exclude' => [
235-
'gzinflate',
236235
'fclose',
237236
'fopen',
237+
'gzinflate',
238+
'iconv',
238239
'mime_content_type',
239240
'rename',
240241
'unlink',

.phpstorm.meta.php

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?php
2+
3+
namespace PHPSTORM_META {
4+
5+
registerArgumentsSet(
6+
"bool",
7+
true,
8+
false
9+
);
10+
11+
registerArgumentsSet(
12+
"compression_methods",
13+
\PhpZip\Constants\ZipCompressionMethod::STORED,
14+
\PhpZip\Constants\ZipCompressionMethod::DEFLATED,
15+
\PhpZip\Constants\ZipCompressionMethod::BZIP2
16+
);
17+
expectedArguments(\PhpZip\ZipFile::addFile(), 2, argumentsSet("compression_methods"));
18+
expectedArguments(\PhpZip\ZipFile::addFromStream(), 2, argumentsSet("compression_methods"));
19+
expectedArguments(\PhpZip\ZipFile::addFromString(), 2, argumentsSet("compression_methods"));
20+
expectedArguments(\PhpZip\ZipFile::addDir(), 2, argumentsSet("compression_methods"));
21+
expectedArguments(\PhpZip\ZipFile::addDirRecursive(), 2, argumentsSet("compression_methods"));
22+
expectedArguments(\PhpZip\ZipFile::addFilesFromIterator(), 2, argumentsSet("compression_methods"));
23+
expectedArguments(\PhpZip\ZipFile::addFilesFromIterator(), 2, argumentsSet("compression_methods"));
24+
expectedArguments(\PhpZip\ZipFile::addFilesFromGlob(), 3, argumentsSet("compression_methods"));
25+
expectedArguments(\PhpZip\ZipFile::addFilesFromGlobRecursive(), 3, argumentsSet("compression_methods"));
26+
expectedArguments(\PhpZip\ZipFile::addFilesFromRegex(), 3, argumentsSet("compression_methods"));
27+
expectedArguments(\PhpZip\ZipFile::addFilesFromRegexRecursive(), 3, argumentsSet("compression_methods"));
28+
expectedArguments(\PhpZip\ZipFile::setCompressionMethodEntry(), 1, argumentsSet("compression_methods"));
29+
expectedArguments(\PhpZip\Model\ZipEntry::setCompressionMethod(), 0, argumentsSet("compression_methods"));
30+
expectedArguments(\PhpZip\Model\ZipEntry::setMethod(), 0, argumentsSet("compression_methods"));
31+
32+
registerArgumentsSet(
33+
'compression_levels',
34+
\PhpZip\Constants\ZipCompressionLevel::MAXIMUM,
35+
\PhpZip\Constants\ZipCompressionLevel::NORMAL,
36+
\PhpZip\Constants\ZipCompressionLevel::FAST,
37+
\PhpZip\Constants\ZipCompressionLevel::SUPER_FAST
38+
);
39+
expectedArguments(\PhpZip\ZipFile::setCompressionLevel(), 0, argumentsSet("compression_levels"));
40+
expectedArguments(\PhpZip\ZipFile::setCompressionLevelEntry(), 1, argumentsSet("compression_levels"));
41+
expectedArguments(\PhpZip\Model\ZipEntry::setCompressionLevel(), 0, argumentsSet("compression_levels"));
42+
43+
registerArgumentsSet(
44+
'encryption_methods',
45+
\PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_256,
46+
\PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_192,
47+
\PhpZip\Constants\ZipEncryptionMethod::WINZIP_AES_128,
48+
\PhpZip\Constants\ZipEncryptionMethod::PKWARE
49+
);
50+
expectedArguments(\PhpZip\ZipFile::setPassword(), 1, argumentsSet("encryption_methods"));
51+
expectedArguments(\PhpZip\ZipFile::setPasswordEntry(), 2, argumentsSet("encryption_methods"));
52+
expectedArguments(\PhpZip\Model\ZipEntry::setEncryptionMethod(), 0, argumentsSet("encryption_methods"));
53+
expectedArguments(\PhpZip\Model\ZipEntry::setPassword(), 1, argumentsSet("encryption_methods"));
54+
55+
registerArgumentsSet(
56+
'zip_mime_types',
57+
null,
58+
'application/zip',
59+
'application/vnd.android.package-archive',
60+
'application/java-archive'
61+
);
62+
expectedArguments(\PhpZip\ZipFile::outputAsAttachment(), 1, argumentsSet("zip_mime_types"));
63+
expectedArguments(\PhpZip\ZipFile::outputAsAttachment(), 2, argumentsSet("bool"));
64+
65+
expectedArguments(\PhpZip\ZipFile::outputAsResponse(), 2, argumentsSet("zip_mime_types"));
66+
expectedArguments(\PhpZip\ZipFile::outputAsResponse(), 3, argumentsSet("bool"));
67+
68+
registerArgumentsSet(
69+
'dos_charset',
70+
\PhpZip\Constants\DosCodePage::CP_LATIN_US,
71+
\PhpZip\Constants\DosCodePage::CP_GREEK,
72+
\PhpZip\Constants\DosCodePage::CP_BALT_RIM,
73+
\PhpZip\Constants\DosCodePage::CP_LATIN1,
74+
\PhpZip\Constants\DosCodePage::CP_LATIN2,
75+
\PhpZip\Constants\DosCodePage::CP_CYRILLIC,
76+
\PhpZip\Constants\DosCodePage::CP_TURKISH,
77+
\PhpZip\Constants\DosCodePage::CP_PORTUGUESE,
78+
\PhpZip\Constants\DosCodePage::CP_ICELANDIC,
79+
\PhpZip\Constants\DosCodePage::CP_HEBREW,
80+
\PhpZip\Constants\DosCodePage::CP_CANADA,
81+
\PhpZip\Constants\DosCodePage::CP_ARABIC,
82+
\PhpZip\Constants\DosCodePage::CP_NORDIC,
83+
\PhpZip\Constants\DosCodePage::CP_CYRILLIC_RUSSIAN,
84+
\PhpZip\Constants\DosCodePage::CP_GREEK2,
85+
\PhpZip\Constants\DosCodePage::CP_THAI,
86+
);
87+
expectedArguments(\PhpZip\Model\ZipEntry::setCharset(), 0, argumentsSet('dos_charset'));
88+
expectedArguments(\PhpZip\Constants\DosCodePage::toUTF8(), 1, argumentsSet('dos_charset'));
89+
expectedArguments(\PhpZip\Constants\DosCodePage::fromUTF8(), 1, argumentsSet('dos_charset'));
90+
91+
registerArgumentsSet(
92+
"zip_os",
93+
\PhpZip\Constants\ZipPlatform::OS_UNIX,
94+
\PhpZip\Constants\ZipPlatform::OS_DOS,
95+
\PhpZip\Constants\ZipPlatform::OS_MAC_OSX,
96+
);
97+
expectedArguments(\PhpZip\Model\ZipEntry::setCreatedOS(), 0, argumentsSet('zip_os'));
98+
expectedArguments(\PhpZip\Model\ZipEntry::setExtractedOS(), 0, argumentsSet('zip_os'));
99+
expectedArguments(\PhpZip\Model\ZipEntry::setPlatform(), 0, argumentsSet('zip_os'));
100+
101+
registerArgumentsSet(
102+
"zip_gpbf",
103+
\PhpZip\Constants\GeneralPurposeBitFlag::ENCRYPTION |
104+
\PhpZip\Constants\GeneralPurposeBitFlag::DATA_DESCRIPTOR |
105+
\PhpZip\Constants\GeneralPurposeBitFlag::COMPRESSION_FLAG1 |
106+
\PhpZip\Constants\GeneralPurposeBitFlag::COMPRESSION_FLAG2 |
107+
\PhpZip\Constants\GeneralPurposeBitFlag::UTF8
108+
);
109+
expectedArguments(\PhpZip\Model\ZipEntry::setGeneralPurposeBitFlags(), 0, argumentsSet('zip_gpbf'));
110+
}

.travis.yml

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,67 @@
1-
dist: trusty
2-
31
language: php
4-
php:
5-
- '5.5'
6-
- '5.6'
7-
- '7.0'
8-
- '7.1'
9-
- '7.2'
10-
- '7.3'
11-
- '7.4'
2+
3+
env:
4+
global:
5+
- ZIPALIGN_INSTALL=false
6+
- COVERAGE=false
7+
- PHPUNIT_FLAGS="-v -c phpunit.xml --testsuite only_fast_tests"
8+
9+
matrix:
10+
include:
11+
- php: 5.5
12+
os: linux
13+
dist: trusty
14+
15+
- php: 5.6
16+
os: linux
17+
dist: xenial
18+
env: ZIPALIGN_INSTALL=true
19+
20+
- php: 7.0
21+
os: linux
22+
dist: xenial
23+
env: ZIPALIGN_INSTALL=true
24+
25+
- php: 7.1
26+
os: linux
27+
dist: xenial
28+
env: ZIPALIGN_INSTALL=true
29+
30+
- php: 7.2
31+
os: linux
32+
dist: xenial
33+
env: ZIPALIGN_INSTALL=true
34+
35+
- php: 7.3
36+
os: linux
37+
dist: xenial
38+
env: ZIPALIGN_INSTALL=true
39+
40+
- php: 7.4
41+
os: linux
42+
dist: bionic
43+
env: COVERAGE=true ZIPALIGN_INSTALL=true PHPUNIT_FLAGS="-v -c phpunit.xml --testsuite only_fast_tests --coverage-clover=coverage.clover"
44+
45+
before_install:
46+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
1247

1348
install:
1449
- travis_retry composer self-update && composer --version
1550
- travis_retry composer install --no-interaction
1651

52+
addons:
53+
apt:
54+
packages:
55+
- unzip
56+
- p7zip-full
57+
1758
before_script:
18-
- sudo apt-get install p7zip-full
59+
- if [[ $ZIPALIGN_INSTALL = true ]]; then sudo apt-get install -y zipalign; fi
1960

2061
script:
2162
- composer validate --no-check-lock
22-
- vendor/bin/phpunit -v -c phpunit.xml
63+
- vendor/bin/phpunit ${PHPUNIT_FLAGS}
64+
65+
after_success:
66+
- if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
67+
- if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

CHANGELOG.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)