Skip to content

feat: drop support for php 7.4 and 8.0 (WIP) #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/php_code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Files
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.dir }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/php_static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-20.04']
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['8.1']

steps:
- name: Setup PHP
Expand All @@ -22,18 +22,18 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: none

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Files
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.dir }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/php_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-20.04']
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['8.1', '8.2', '8.3']

steps:
- name: Setup PHP
Expand All @@ -22,18 +22,18 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: none

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Files
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.dir }}
Expand Down
25 changes: 12 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,30 @@
"sort-packages": true
},
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-fileinfo": "*",
"ext-iconv": "*",
"ext-imap": "*",
"ext-mbstring": "*",
"ext-json": "*"
"ext-json": "*",
"ext-random": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"maglnet/composer-require-checker": "^2.0|^3.2",
"nikic/php-parser": "^4.3,<4.7|^4.10",
"paragonie/hidden-string": "^1.0",
"friendsofphp/php-cs-fixer": "^3.38",
"maglnet/composer-require-checker": "^4.7",
"nikic/php-parser": "^4.17",
"paragonie/hidden-string": "^2.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpunit/phpunit": "^8.5|^9.5",
"povils/phpmnd": "^2.2",
"psalm/plugin-phpunit": "^0.10.0|^0.15.1",
"roave/security-advisories": "dev-master",
"sebastian/phpcpd": "^4.1|^6.0"
"phpunit/phpunit": "^10.5.10",
"povils/phpmnd": "^3.4",
"psalm/plugin-phpunit": "^0.18.4",
"roave/security-advisories": "dev-master"
},
"scripts": {
"static-analysis": [
"parallel-lint .php-cs-fixer.dist.php src tests examples",
"phpcpd src tests",
"composer-require-checker check --config-file=composer-require-checker.config.json ./composer.json",
"phpmnd ./ --exclude=./.github/ --exclude=./examples/ --exclude=./vendor/ --non-zero-exit-on-violation --hint",
"phpmnd ./ --exclude=./.github/ --exclude=./examples/ --exclude=./vendor/ --hint",
"php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run -v",
"psalm --show-info=false"
],
Expand Down
19 changes: 6 additions & 13 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
verbose="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
colors="true"
forceCoversAnnotation="false"
processIsolation="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd">

<source>
<include>
<directory>src</directory>
</include>
</coverage>
</source>

<testsuites>
<testsuite name="php-imap Tests">
<directory>tests</directory>
</testsuite>
</testsuites>

</phpunit>
2 changes: 1 addition & 1 deletion tests/unit/ImapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ImapTest extends Base
/**
* @psalm-return Generator<'CI ENV with invalid password'|'empty mailbox/username/password', array{0: ConnectionException::class, 1: '/^[AUTHENTICATIONFAILED]/'|'Can't open mailbox : no such mailbox', 2: array{0: HiddenString, 1: HiddenString, 2: HiddenString, 3: 0, 4: 0, 5: array<empty, empty>}, 3?: true}, mixed, void>
*/
public function OpenFailure(): Generator
public static function OpenFailure(): Generator
{
yield 'empty mailbox/username/password' => [
ConnectionException::class,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Issue519Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Issue519Test extends TestCase
*
* @return string[][]
*/
public function provider(): array
public static function provider(): array
{
$out = [];

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/LiveMailboxStringDecodingConvertingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LiveMailboxStringDecodingConvertingTest extends TestCase
/**
* Provides data for testing string decoding.
*/
public function stringDecodeProvider(): Generator
public static function stringDecodeProvider(): Generator
{
yield 'Issue #250 iso-8859-1' => [
ENCQUOTEDPRINTABLE,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/LiveMailboxTestingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait LiveMailboxTestingTrait
*
* @return (\ParagonIE\HiddenString\HiddenString|string)[][]
*/
public function MailBoxProvider(): array
public static function MailBoxProvider(): array
{
$sets = [];

Expand Down
26 changes: 13 additions & 13 deletions tests/unit/MailboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testConstructorTrimsPossibleVariables(): void
*
* @return string[][]
*/
public function SetAndGetServerEncodingProvider(): array
public static function SetAndGetServerEncodingProvider(): array
{
$data = [
['UTF-8'],
Expand Down Expand Up @@ -168,7 +168,7 @@ public function testServerEncodingUppersSetting(): void
*
* @psalm-return array{UTF-7: array{0: true, 1: 'UTF-7'}, UTF7-IMAP: array{0: true, 1: 'UTF7-IMAP'}, UTF-8: array{0: true, 1: 'UTF-8'}, ASCII: array{0: true, 1: 'ASCII'}, US-ASCII: array{0: true, 1: 'US-ASCII'}, ISO-8859-1: array{0: true, 1: 'ISO-8859-1'}, UTF7: array{0: false, 1: 'UTF7'}, UTF-7-IMAP: array{0: false, 1: 'UTF-7-IMAP'}, UTF-7IMAP: array{0: false, 1: 'UTF-7IMAP'}, UTF8: array{0: false, 1: 'UTF8'}, USASCII: array{0: false, 1: 'USASCII'}, ASC11: array{0: false, 1: 'ASC11'}, ISO-8859-0: array{0: false, 1: 'ISO-8859-0'}, ISO-8855-1: array{0: false, 1: 'ISO-8855-1'}, ISO-8859: array{0: false, 1: 'ISO-8859'}}
*/
public function serverEncodingProvider(): array
public static function serverEncodingProvider(): array
{
return [
// Supported encodings
Expand Down Expand Up @@ -262,7 +262,7 @@ public function testPathDelimiterHasADefault(): void
*
* @return string[][]
*/
public function pathDelimiterProvider(): array
public static function pathDelimiterProvider(): array
{
return [
'0' => ['0'],
Expand Down Expand Up @@ -372,7 +372,7 @@ public function testGetAttachmentsAreNotIgnoredByDefault(): void
*
* @psalm-return array<string, array{0:bool}>
*/
public function attachmentsIgnoreProvider(): array
public static function attachmentsIgnoreProvider(): array
{
/** @psalm-var array<string, array{0:bool}> */
return [
Expand Down Expand Up @@ -400,7 +400,7 @@ public function testSetAttachmentsIgnore(bool $paramValue): void
*
* @return string[][]
*/
public function encodingTestStringsProvider(): array
public static function encodingTestStringsProvider(): array
{
return [
'Avañe’ẽ' => ['Avañe’ẽ'], // Guaraní
Expand Down Expand Up @@ -468,7 +468,7 @@ public function testMimeDecodingReturnsCorrectValues(string $str): void
*
* @return (int|string)[][]
*/
public function datetimeProvider(): array
public static function datetimeProvider(): array
{
return [
'Sun, 14 Aug 2005 16:13:03 +0000 (CEST)' => ['2005-08-14T16:13:03+00:00', 1124035983],
Expand Down Expand Up @@ -507,7 +507,7 @@ public function testParsedDateDifferentTimeZones(string $dateToParse, int $epoch
*
* @return string[][]
*/
public function invalidDatetimeProvider(): array
public static function invalidDatetimeProvider(): array
{
return [
'Sun, 14 Aug 2005 16:13:03 +9000 (CEST)' => ['Sun, 14 Aug 2005 16:13:03 +9000 (CEST)'],
Expand Down Expand Up @@ -543,7 +543,7 @@ public function testParsedDateTimeWithEmptyHeaderDate(): void
*
* @psalm-return array{0: array{0: '=?iso-8859-1?Q?Sebastian_Kr=E4tzig?= <[email protected]>', 1: 'Sebastian Krätzig <[email protected]>'}, 1: array{0: '=?iso-8859-1?Q?Sebastian_Kr=E4tzig?=', 1: 'Sebastian Krätzig'}, 2: array{0: 'sebastian.kraetzig', 1: 'sebastian.kraetzig'}, 3: array{0: '=?US-ASCII?Q?Keith_Moore?= <[email protected]>', 1: 'Keith Moore <[email protected]>'}, 4: array{0: ' ', 1: ' '}, 5: array{0: '=?ISO-8859-1?Q?Max_J=F8rn_Simsen?= <[email protected]>', 1: 'Max Jørn Simsen <[email protected]>'}, 6: array{0: '=?ISO-8859-1?Q?Andr=E9?= Muster <[email protected]>', 1: 'André Muster <[email protected]>'}, 7: array{0: '=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=', 1: 'If you can read this you understand the example.'}, 8: array{0: '', 1: ''}}
*/
public function mimeEncodingProvider(): array
public static function mimeEncodingProvider(): array
{
return [
['=?iso-8859-1?Q?Sebastian_Kr=E4tzig?= <[email protected]>', 'Sebastian Krätzig <[email protected]>'],
Expand Down Expand Up @@ -575,7 +575,7 @@ public function testMimeEncoding(string $str, string $expected): void
*
* @psalm-return array<string, array{0:'assertNull'|'expectException', 1:int, 2:list<1|2|3|4>}>
*/
public function timeoutsProvider(): array
public static function timeoutsProvider(): array
{
/** @psalm-var array<string, array{0:'assertNull'|'expectException', 1:int, 2:list<int>}> */
return [
Expand Down Expand Up @@ -614,7 +614,7 @@ public function testSetTimeouts(string $assertMethod, int $timeout, array $types
*
* @psalm-return Generator<string, array{0: 'assertNull'|'expectException', 1: int, 2: 0, 3: array<empty, empty>}, mixed, void>
*/
public function connectionArgsProvider(): Generator
public static function connectionArgsProvider(): Generator
{
yield from [
'readonly, disable gssapi' => ['assertNull', OP_READONLY, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']],
Expand Down Expand Up @@ -700,7 +700,7 @@ public function testSetConnectionArgs(string $assertMethod, int $option, int $re
*
* @return string[][]
*/
public function mimeStrDecodingProvider(): array
public static function mimeStrDecodingProvider(): array
{
return [
'<[email protected]>' => ['<[email protected]>', '<[email protected]>'],
Expand Down Expand Up @@ -737,7 +737,7 @@ public function testDecodeMimeStr(string $str, string $expectedStr, string $serv
*
* @return string[][]
*/
public function Base64DecodeProvider(): array
public static function Base64DecodeProvider(): array
{
return [
['bm8tcmVwbHlAZXhhbXBsZS5jb20=', '[email protected]'],
Expand All @@ -764,7 +764,7 @@ public function testBase64Decode(string $input, string $expected): void
*
* @return string[][]
*/
public function attachmentDirFailureProvider(): array
public static function attachmentDirFailureProvider(): array
{
return [
[
Expand Down