Skip to content

Commit f131ca3

Browse files
committed
Drop PHP 7.4 support
This is according to our formal, published, policy to only support EOL PHP after 6 months. See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support Also share the exact same dev deps across all PHP version for GitHub Actions so runs are faster, much most importantly they are stable and predictable. And we decide manually when we want to migrate to PHPUnit 10. Fixes PHPOffice#3634 Closes PHPOffice#3710
1 parent 7288b4d commit f131ca3

24 files changed

+379
-686
lines changed

.github/workflows/github-pages.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup PHP, with composer and extensions
1515
uses: shivammathur/setup-php@v2
1616
with:
17-
php-version: 7.4
17+
php-version: 8.1
1818
coverage: none # remove xdebug
1919

2020
- name: Build API documentation

.github/workflows/main.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
experimental:
99
- false
1010
php-version:
11-
- '7.4'
1211
- '8.0'
1312
- '8.1'
1413
- '8.2'
@@ -43,32 +42,25 @@ jobs:
4342

4443
- name: Delete composer lock file
4544
id: composer-lock
46-
if: ${{ matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == 'nightly' }}
45+
if: ${{ matrix.php-version == 'nightly' }}
4746
run: |
4847
rm composer.lock
4948
echo "flags=--ignore-platform-reqs" >> $GITHUB_OUTPUT
5049
5150
- name: Install dependencies
52-
run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }}
51+
run: composer install --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }}
5352

5453
- name: Setup problem matchers for PHP
5554
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
5655

5756
- name: Setup problem matchers for PHPUnit
5857
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
5958

60-
- name: "Run PHPUnit tests 1 (Experimental: ${{ matrix.experimental }})"
59+
- name: "Run PHPUnit tests (Experimental: ${{ matrix.experimental }})"
6160
env:
6261
FAILURE_ACTION: "${{ matrix.experimental == true }}"
63-
if: ${{ matrix.php-version == '7.4' || matrix.php-version == '8.0' }}
6462
run: vendor/bin/phpunit --verbose || $FAILURE_ACTION
6563

66-
- name: "Run PHPUnit tests 2 (Experimental: ${{ matrix.experimental }})"
67-
env:
68-
FAILURE_ACTION: "${{ matrix.experimental == true }}"
69-
if: ${{ matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == 'nightly' }}
70-
run: vendor/bin/phpunit -c phpunit10.xml.dist --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings || $FAILURE_ACTION
71-
7264
php-cs-fixer:
7365
runs-on: ubuntu-latest
7466
steps:
@@ -160,7 +152,7 @@ jobs:
160152
run: composer install --no-progress --prefer-dist --optimize-autoloader
161153

162154
- name: Code Version Compatibility check with PHP_CodeSniffer
163-
run: ./vendor/bin/phpcs -q --report-width=200 --report=summary,full src/ --standard=PHPCompatibility --runtime-set testVersion 7.4-
155+
run: ./vendor/bin/phpcs -q --report-width=200 --report=summary,full src/ --standard=PHPCompatibility --runtime-set testVersion 8.0-
164156

165157
phpstan:
166158
runs-on: ubuntu-latest

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1515

1616
### Changed
1717

18+
- Drop support for PHP 7.4, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support [PR #3713](https://github.com/PHPOffice/PhpSpreadsheet/pull/3713)
1819
- RLM Added to NumberFormatter Currency. This happens depending on release of ICU which Php is using (it does not yet happen with any official release). PhpSpreadsheet will continue to use the value returned by Php, but a method is added to keep the result unchanged from release to release. [Issue #3571](https://github.com/PHPOffice/PhpSpreadsheet/issues/3571) [PR #3640](https://github.com/PHPOffice/PhpSpreadsheet/pull/3640)
1920

2021
### Deprecated

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ If you would like to contribute, here are some notes and guidelines:
44

55
- All new development should be on feature/fix branches, which are then merged to the `master` branch once stable and approved; so the `master` branch is always the most up-to-date, working code
66
- If you are going to submit a pull request, please fork from `master`, and submit your pull request back as a fix/feature branch referencing the GitHub issue number
7-
- The code must work with all PHP versions that we support (currently PHP 7.4 to PHP 8.2).
7+
- The code must work with all PHP versions that we support.
88
- You can call `composer versions` to test version compatibility.
99
- Code style should be maintained.
1010
- `composer style` will identify any issues with Coding Style`.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ allow you to read and write various spreadsheet file formats such as Excel and L
1616
LTS: Support for PHP versions will only be maintained for a period of six months beyond the
1717
[end of life](https://www.php.net/supported-versions) of that PHP version.
1818

19-
Currently the required PHP minimum version is PHP __7.4__, and we [will support that version](https://www.php.net/eol.php) until 28th June 2023.
19+
Currently the required PHP minimum version is PHP __8.0__, and we [will support that version](https://www.php.net/eol.php) until May 2024.
2020

2121
See the `composer.json` for other requirements.
2222

@@ -36,7 +36,7 @@ If you are building your installation on a development machine that is on a diff
3636
},
3737
"config": {
3838
"platform": {
39-
"php": "7.4"
39+
"php": "8.0"
4040
}
4141
}
4242
}

composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"scripts": {
4444
"check": [
4545
"phpcs src/ tests/ --report=checkstyle",
46-
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.4- -n",
46+
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 8.0- -n",
4747
"php-cs-fixer fix --ansi --dry-run --diff",
4848
"phpunit --color=always",
4949
"phpstan analyse --ansi --memory-limit=2048M"
@@ -57,11 +57,11 @@
5757
"php-cs-fixer fix"
5858
],
5959
"versions": [
60-
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.4- -n"
60+
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 8.0- -n"
6161
]
6262
},
6363
"require": {
64-
"php": "^7.4 || ^8.0",
64+
"php": "^8.0",
6565
"ext-ctype": "*",
6666
"ext-dom": "*",
6767
"ext-fileinfo": "*",
@@ -85,14 +85,14 @@
8585
},
8686
"require-dev": {
8787
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
88-
"dompdf/dompdf": "^1.0 || ^2.0",
88+
"dompdf/dompdf": "^2.0",
8989
"friendsofphp/php-cs-fixer": "^3.2",
9090
"mitoteam/jpgraph": "^10.3",
9191
"mpdf/mpdf": "^8.1.1",
9292
"phpcompatibility/php-compatibility": "^9.3",
9393
"phpstan/phpstan": "^1.1",
9494
"phpstan/phpstan-phpunit": "^1.0",
95-
"phpunit/phpunit": "^8.5 || ^9.0 || ^10.0",
95+
"phpunit/phpunit": "^9.6",
9696
"squizlabs/php_codesniffer": "^3.7",
9797
"tecnickcom/tcpdf": "^6.5"
9898
},

0 commit comments

Comments
 (0)