Skip to content
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

Enhancement: Add support for PHP 8.0 #752

Merged
merged 1 commit into from
Jan 29, 2024
Merged
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
12 changes: 0 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ For details, take a look at the following workflow configuration files:
- [`workflows/renew.yaml`](workflows/renew.yaml)
- [`workflows/triage.yaml`](workflows/triage.yaml)

## Backward-Compatibility Analysis

We use [`roave/backward-compatibility-check`](https://github.com/Roave/BackwardCompatibilityCheck) to prevent breaking backwards-compatibility.

Run

```sh
make backward-compatibility-analysis
```

to run a backward-compatibility analysis.

## Coding Standards

We use [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`.
Expand Down
18 changes: 10 additions & 8 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ branches:
required_approving_review_count: 1
required_status_checks:
checks:
- context: "Backward-Compatibility Analysis (8.1, locked)"
- context: "Code Coverage (8.1, locked)"
- context: "Coding Standards (8.1, locked)"
- context: "Dependency Analysis (8.1, locked)"
- context: "Mutation Tests (8.1, locked)"
- context: "Refactoring (8.1, locked)"
- context: "Security Analysis (8.1, locked)"
- context: "Static Code Analysis (8.1, locked)"
- context: "Code Coverage (8.0, locked)"
- context: "Coding Standards (8.0, locked)"
- context: "Dependency Analysis (8.0, locked)"
- context: "Mutation Tests (8.0, locked)"
- context: "Refactoring (8.0, locked)"
- context: "Security Analysis (8.0, locked)"
- context: "Static Code Analysis (8.0, locked)"
- context: "Tests (8.0, highest)"
- context: "Tests (8.0, locked)"
- context: "Tests (8.0, lowest)"
- context: "Tests (8.1, highest)"
- context: "Tests (8.1, locked)"
- context: "Tests (8.1, lowest)"
Expand Down
83 changes: 16 additions & 67 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,6 @@ on: # yamllint disable-line rule:truthy
- "main"

jobs:
backward-compatibility-analysis:
name: "Backward-Compatibility Analysis"

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
- "8.1"

dependencies:
- "locked"

steps:
- name: "Checkout"
uses: "actions/checkout@v4.1.1"
with:
fetch-depth: 0

- name: "Set up PHP"
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.9.0"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v4.0.0"
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "ergebnis/.github/actions/composer/install@1.9.0"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run backward-compatibility analysis with roave/backward-compatibility-check"
run: "vendor/bin/roave-backward-compatibility-check --ansi --format=github-actions"

code-coverage:
name: "Code Coverage"

Expand All @@ -71,7 +19,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -84,7 +32,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "xdebug"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down Expand Up @@ -132,7 +80,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -152,7 +100,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
tools: "phive"

Expand Down Expand Up @@ -207,7 +155,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -220,7 +168,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
tools: "phive"

Expand Down Expand Up @@ -263,7 +211,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -276,7 +224,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "xdebug"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down Expand Up @@ -315,7 +263,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -328,7 +276,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down Expand Up @@ -374,7 +322,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -387,7 +335,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down Expand Up @@ -424,7 +372,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -437,7 +385,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, opcache, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, opcache, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down Expand Up @@ -475,6 +423,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
Expand All @@ -492,7 +441,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand All @@ -32,7 +32,7 @@ jobs:
uses: "shivammathur/setup-php@2.29.0"
with:
coverage: "none"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-normalize" version="^2.41.0" installed="2.41.0" location="./.phive/composer-normalize" copy="false"/>
<phar name="composer-require-checker" version="^4.7.1" installed="4.7.1" location="./.phive/composer-require-checker" copy="false"/>
<phar name="composer-normalize" version="^2.31.0" installed="2.31.0" location="./.phive/composer-normalize" copy="false"/>
<phar name="composer-require-checker" version="^4.4.0" installed="4.4.0" location="./.phive/composer-require-checker" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

$license->save();

$ruleSet = PhpCsFixer\Config\RuleSet\Php81::create()
$ruleSet = PhpCsFixer\Config\RuleSet\Php80::create()
->withHeader($license->header())
->withRules(PhpCsFixer\Config\Rules::fromArray([
'escape_implicit_backslashes' => false,
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`3.4.0...main`][3.4.0...main].

### Changed

- Added support for PHP 8.0 ([#752]), by [@localheinz]

## [`3.4.0`][3.4.0]

For a full diff see [`3.3.0...3.4.0`][3.3.0...3.4.0].
Expand Down Expand Up @@ -177,6 +181,7 @@ For a full diff see [`8849fc6...1.0.0`][8849fc6...1.0.0].
[#520]: https://github.com/ergebnis/json-printer/pull/520
[#625]: https://github.com/ergebnis/json-printer/pull/625
[#682]: https://github.com/ergebnis/json-printer/pull/682
[#752]: https://github.com/ergebnis/json-printer/pull/752

[@ergebnis]: https://github.com/ergebnis
[@localheinz]: https://github.com/localheinz
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
"security": "https://github.com/ergebnis/json-printer/blob/main/.github/SECURITY.md"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"ergebnis/data-provider": "^3.2.0",
"ergebnis/license": "^2.4.0",
"ergebnis/php-cs-fixer-config": "^6.20.0",
"ergebnis/phpunit-slow-test-detector": "^2.9.0",
"fakerphp/faker": "^1.23.1",
"infection/infection": "~0.27.9",
"phpunit/phpunit": "^10.5.9",
"infection/infection": "~0.26.19",
"phpunit/phpunit": "^9.6.16",
"psalm/plugin-phpunit": "~0.18.4",
"rector/rector": "~0.19.2",
"roave/backward-compatibility-check": "^8.6.0",
"vimeo/psalm": "^5.20.0"
},
"autoload": {
Expand All @@ -56,6 +56,9 @@
"audit": {
"abandoned": "report"
},
"platform": {
"php": "8.0.30"
},
"preferred-install": "dist",
"sort-packages": true
}
Expand Down
Loading
Loading