Skip to content

Commit 9c5a8fe

Browse files
authored
Merge pull request #1278 from ergebnis/feature/php80
Enhancement: Add support for PHP 8.0
2 parents 69cf31e + e407029 commit 9c5a8fe

Some content is hidden

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

44 files changed

+890
-1300
lines changed

.github/CONTRIBUTING.md

-12
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ For details, take a look at the following workflow configuration files:
1111
- [`workflows/triage.yaml`](workflows/triage.yaml)
1212
- [`workflows/update.yaml`](workflows/update.yaml)
1313

14-
## Backward-Compatibility Analysis
15-
16-
We use [`roave/backward-compatibility-check`](https://github.com/Roave/BackwardCompatibilityCheck) to prevent breaking backwards-compatibility.
17-
18-
Run
19-
20-
```sh
21-
make backward-compatibility-analysis
22-
```
23-
24-
to run a backward-compatibility analysis.
25-
2614
## Coding Standards
2715

2816
We use [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`.

.github/settings.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ branches:
1414
required_approving_review_count: 1
1515
required_status_checks:
1616
checks:
17-
- context: "Backward-Compatibility Analysis (8.1, locked)"
18-
- context: "Code Coverage (8.1, locked)"
19-
- context: "Coding Standards (8.1, locked)"
20-
- context: "Compile Phar (8.1, locked)"
21-
- context: "Dependency Analysis (8.1, locked)"
22-
- context: "Mutation Tests (8.1, locked)"
23-
- context: "Refactoring (8.1, locked)"
24-
- context: "Security Analysis (8.1, locked)"
25-
- context: "Static Code Analysis (8.1, locked)"
17+
- context: "Code Coverage (8.0, locked)"
18+
- context: "Coding Standards (8.0, locked)"
19+
- context: "Compile Phar (8.0, locked)"
20+
- context: "Dependency Analysis (8.0, locked)"
21+
- context: "Mutation Tests (8.0, locked)"
22+
- context: "Refactoring (8.0, locked)"
23+
- context: "Security Analysis (8.0, locked)"
24+
- context: "Static Code Analysis (8.0, locked)"
25+
- context: "Tests (8.0, highest)"
26+
- context: "Tests (8.0, locked)"
27+
- context: "Tests (8.0, lowest)"
2628
- context: "Tests (8.1, highest)"
2729
- context: "Tests (8.1, locked)"
2830
- context: "Tests (8.1, lowest)"

.github/workflows/integrate.yaml

+18-69
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,6 @@ on: # yamllint disable-line rule:truthy
99
- "main"
1010

1111
jobs:
12-
backward-compatibility-analysis:
13-
name: "Backward-Compatibility Analysis"
14-
15-
runs-on: "ubuntu-latest"
16-
17-
timeout-minutes: 5
18-
19-
strategy:
20-
matrix:
21-
php-version:
22-
- "8.1"
23-
24-
dependencies:
25-
- "locked"
26-
27-
steps:
28-
- name: "Checkout"
29-
uses: "actions/[email protected]"
30-
with:
31-
fetch-depth: 0
32-
33-
- name: "Set up PHP"
34-
uses: "shivammathur/[email protected]"
35-
with:
36-
coverage: "none"
37-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
38-
php-version: "${{ matrix.php-version }}"
39-
40-
- name: "Set up problem matchers for PHP"
41-
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
42-
43-
- name: "Validate composer.json and composer.lock"
44-
run: "composer validate --ansi --strict"
45-
46-
- name: "Determine composer cache directory"
47-
uses: "ergebnis/.github/actions/composer/[email protected]"
48-
49-
- name: "Cache dependencies installed with composer"
50-
uses: "actions/[email protected]"
51-
with:
52-
path: "${{ env.COMPOSER_CACHE_DIR }}"
53-
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
54-
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
55-
56-
- name: "Install ${{ matrix.dependencies }} dependencies with composer"
57-
uses: "ergebnis/.github/actions/composer/[email protected]"
58-
with:
59-
dependencies: "${{ matrix.dependencies }}"
60-
61-
- name: "Run backward-compatibility analysis with roave/backward-compatibility-check"
62-
run: "vendor/bin/roave-backward-compatibility-check --ansi --format=github-actions --install-development-dependencies"
63-
6412
code-coverage:
6513
name: "Code Coverage"
6614

@@ -71,7 +19,7 @@ jobs:
7119
strategy:
7220
matrix:
7321
php-version:
74-
- "8.1"
22+
- "8.0"
7523

7624
dependencies:
7725
- "locked"
@@ -84,7 +32,7 @@ jobs:
8432
uses: "shivammathur/[email protected]"
8533
with:
8634
coverage: "xdebug"
87-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
35+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
8836
php-version: "${{ matrix.php-version }}"
8937

9038
- name: "Set up problem matchers for PHP"
@@ -132,7 +80,7 @@ jobs:
13280
strategy:
13381
matrix:
13482
php-version:
135-
- "8.1"
83+
- "8.0"
13684

13785
dependencies:
13886
- "locked"
@@ -152,7 +100,7 @@ jobs:
152100
uses: "shivammathur/[email protected]"
153101
with:
154102
coverage: "none"
155-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
103+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
156104
php-version: "${{ matrix.php-version }}"
157105
tools: "phive"
158106

@@ -207,7 +155,7 @@ jobs:
207155
strategy:
208156
matrix:
209157
php-version:
210-
- "8.1"
158+
- "8.0"
211159

212160
dependencies:
213161
- "locked"
@@ -224,7 +172,7 @@ jobs:
224172
uses: "shivammathur/[email protected]"
225173
with:
226174
coverage: "none"
227-
extensions: "none, bcmath, ctype, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
175+
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
228176
ini-values: "memory_limit=-1, phar.readonly=0"
229177
php-version: "${{ matrix.php-version }}"
230178
tools: "phive"
@@ -283,7 +231,7 @@ jobs:
283231
strategy:
284232
matrix:
285233
php-version:
286-
- "8.1"
234+
- "8.0"
287235

288236
dependencies:
289237
- "locked"
@@ -296,7 +244,7 @@ jobs:
296244
uses: "shivammathur/[email protected]"
297245
with:
298246
coverage: "none"
299-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
247+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
300248
php-version: "${{ matrix.php-version }}"
301249
tools: "phive"
302250

@@ -339,7 +287,7 @@ jobs:
339287
strategy:
340288
matrix:
341289
php-version:
342-
- "8.1"
290+
- "8.0"
343291

344292
dependencies:
345293
- "locked"
@@ -352,7 +300,7 @@ jobs:
352300
uses: "shivammathur/[email protected]"
353301
with:
354302
coverage: "xdebug"
355-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
303+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
356304
php-version: "${{ matrix.php-version }}"
357305

358306
- name: "Set up problem matchers for PHP"
@@ -391,7 +339,7 @@ jobs:
391339
strategy:
392340
matrix:
393341
php-version:
394-
- "8.1"
342+
- "8.0"
395343

396344
dependencies:
397345
- "locked"
@@ -404,7 +352,7 @@ jobs:
404352
uses: "shivammathur/[email protected]"
405353
with:
406354
coverage: "none"
407-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
355+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
408356
php-version: "${{ matrix.php-version }}"
409357

410358
- name: "Set up problem matchers for PHP"
@@ -450,7 +398,7 @@ jobs:
450398
strategy:
451399
matrix:
452400
php-version:
453-
- "8.1"
401+
- "8.0"
454402

455403
dependencies:
456404
- "locked"
@@ -463,7 +411,7 @@ jobs:
463411
uses: "shivammathur/[email protected]"
464412
with:
465413
coverage: "none"
466-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
414+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
467415
php-version: "${{ matrix.php-version }}"
468416

469417
- name: "Set up problem matchers for PHP"
@@ -500,7 +448,7 @@ jobs:
500448
strategy:
501449
matrix:
502450
php-version:
503-
- "8.1"
451+
- "8.0"
504452

505453
dependencies:
506454
- "locked"
@@ -513,7 +461,7 @@ jobs:
513461
uses: "shivammathur/[email protected]"
514462
with:
515463
coverage: "none"
516-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, opcache, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
464+
extensions: "none, ctype, curl, dom, json, mbstring, opcache, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
517465
php-version: "${{ matrix.php-version }}"
518466

519467
- name: "Set up problem matchers for PHP"
@@ -551,6 +499,7 @@ jobs:
551499
fail-fast: false
552500
matrix:
553501
php-version:
502+
- "8.0"
554503
- "8.1"
555504
- "8.2"
556505
- "8.3"
@@ -568,7 +517,7 @@ jobs:
568517
uses: "shivammathur/[email protected]"
569518
with:
570519
coverage: "none"
571-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
520+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
572521
php-version: "${{ matrix.php-version }}"
573522

574523
- name: "Set up problem matchers for PHP"

.github/workflows/release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
php-version:
21-
- "8.1"
21+
- "8.0"
2222

2323
dependencies:
2424
- "locked"
@@ -38,7 +38,7 @@ jobs:
3838
uses: "shivammathur/[email protected]"
3939
with:
4040
coverage: "none"
41-
extensions: "none, bcmath, ctype, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
41+
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
4242
php-version: "${{ matrix.php-version }}"
4343
tools: "phive"
4444

.github/workflows/renew.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
php-version:
20-
- "8.1"
20+
- "8.0"
2121

2222
dependencies:
2323
- "locked"
@@ -32,7 +32,7 @@ jobs:
3232
uses: "shivammathur/[email protected]"
3333
with:
3434
coverage: "none"
35-
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
35+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
3636
php-version: "${{ matrix.php-version }}"
3737

3838
- name: "Set up problem matchers for PHP"

.github/workflows/update.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
php-version:
18-
- "8.1"
18+
- "8.0"
1919

2020
steps:
2121
- name: "Checkout"

.phive/phars.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="composer-normalize" version="^2.41.1" installed="2.41.1" location="./.phive/composer-normalize" copy="false"/>
4-
<phar name="composer-require-checker" version="^4.7.1" installed="4.7.1" location="./.phive/composer-require-checker" copy="false"/>
5-
<phar name="humbug/box" version="^4.5.0" installed="4.5.0" location="./.phive/box" copy="false"/>
3+
<phar name="composer-normalize" version="^2.31.0" installed="2.31.0" location="./.phive/composer-normalize" copy="false"/>
4+
<phar name="composer-require-checker" version="^4.4.0" installed="4.4.0" location="./.phive/composer-require-checker" copy="false"/>
5+
<phar name="humbug/box" version="^3.16.0" installed="3.16.0" location="./.phive/box" copy="false"/>
66
</phive>

.php-cs-fixer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
$license->save();
2828

29-
$ruleSet = PhpCsFixer\Config\RuleSet\Php81::create()
29+
$ruleSet = PhpCsFixer\Config\RuleSet\Php80::create()
3030
->withHeader($license->header())
3131
->withRules(PhpCsFixer\Config\Rules::fromArray([
3232
'no_useless_concat_operator' => false,

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ For a full diff see [`2.41.1...main`][2.41.1...main].
1313
- Required `ergebnis/json:^1.2.0` ([#1273]), by [@dependabot]
1414
- Required `ergebnis/json-printer:^3.5.0` ([#1275]), by [@dependabot]
1515
- Required `ergebnis/json-normalizer:^4.5.0` ([#1277]), by [@localheinz]
16+
- Added support for PHP 8.0 ([#1278]), by [@localheinz]
1617

1718
## [`2.41.1`][2.41.1]
1819

@@ -1211,6 +1212,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
12111212
[#1273]: https://github.com/ergebnis/composer-normalize/pull/1273
12121213
[#1275]: https://github.com/ergebnis/composer-normalize/pull/1275
12131214
[#1277]: https://github.com/ergebnis/composer-normalize/pull/1277
1215+
[#1278]: https://github.com/ergebnis/composer-normalize/pull/1278
12141216

12151217
[@core23]: https://github.com/core23
12161218
[@dependabot]: https://github.com/dependabot

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ COMPOSER_VERSION:=2.6.6
33
.PHONY: it
44
it: refactoring coding-standards security-analysis static-code-analysis tests ## Runs the refactoring, coding-standards, security-analysis, static-code-analysis, and tests targets
55

6-
.PHONY: backward-compatibility-analysis
7-
backward-compatibility-analysis: vendor ## Runs a backward-compatibility analysis with roave/backward-compatibility-check
8-
vendor/bin/roave-backward-compatibility-check --install-development-dependencies
9-
106
.PHONY: code-coverage
117
code-coverage: vendor ## Collects coverage from running unit and integration tests with phpunit/phpunit
128
vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text

composer.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md"
2424
},
2525
"require": {
26-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
26+
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
2727
"ext-json": "*",
2828
"composer-plugin-api": "^2.0.0",
2929
"ergebnis/json": "^1.2.0",
@@ -35,15 +35,14 @@
3535
"require-dev": {
3636
"composer/composer": "^2.6.6",
3737
"ergebnis/license": "^2.4.0",
38-
"ergebnis/php-cs-fixer-config": "~6.20.0",
38+
"ergebnis/php-cs-fixer-config": "^6.20.0",
3939
"ergebnis/phpunit-slow-test-detector": "^2.9.0",
4040
"fakerphp/faker": "^1.23.1",
41-
"infection/infection": "~0.27.9",
42-
"phpunit/phpunit": "^10.5.9",
41+
"infection/infection": "~0.26.19",
42+
"phpunit/phpunit": "^9.6.16",
4343
"psalm/plugin-phpunit": "~0.18.4",
44-
"rector/rector": "~0.19.5",
45-
"roave/backward-compatibility-check": "^8.6.0",
46-
"symfony/filesystem": "^6.4.0",
44+
"rector/rector": "~0.19.2",
45+
"symfony/filesystem": "^6.0.19",
4746
"vimeo/psalm": "^5.20.0"
4847
},
4948
"minimum-stability": "dev",
@@ -67,7 +66,7 @@
6766
"abandoned": "report"
6867
},
6968
"platform": {
70-
"php": "8.1.26"
69+
"php": "8.0.30"
7170
},
7271
"preferred-install": "dist",
7372
"sort-packages": true

0 commit comments

Comments
 (0)