Skip to content

Commit 3704dbb

Browse files
authored
Merge pull request #85 from denniscoorn/feature/php-81-compatibility
Support and compatibility added for PHP 8.1
2 parents 64e6a8a + b00b00f commit 3704dbb

15 files changed

+622
-626
lines changed

Diff for: .editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[Makefile]
12+
indent_style = tab
13+
14+
[*.{yml,yaml,yaml.dist}]
15+
indent_size = 2

Diff for: .github/workflows/deploy.yaml

+9-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
release:
55
# Every published release will trigger a distribution app build which will
6-
# added to the release a asset.
6+
# added to the release an asset.
77
types: [published]
88

99
env:
@@ -18,25 +18,20 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Setup PHP with Composer v1
21+
- name: Setup PHP
2222
uses: shivammathur/setup-php@v2
2323
with:
24-
php-version: '7.3'
25-
tools: composer:v1
24+
# It's important to use the lowest supported PHP version when building the release-tool.
25+
# Otherwise, users can be confronted with a composer platform check error when they use
26+
# a PHP version that's lower than the version used here to build the release-tool.
27+
php-version: '7.4'
2628

27-
- name: Get Composer Cache Directory
28-
id: composer-cache
29-
run: |
30-
echo "::set-output name=dir::$(composer config cache-files-dir)"
31-
- uses: actions/cache@v3
32-
with:
33-
path: ${{ steps.composer-cache.outputs.dir }}
34-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
35-
restore-keys: |
36-
${{ runner.os }}-composer-
29+
- name: Composer Install
30+
uses: ramsey/composer-install@v2
3731

3832
- name: Create build
3933
run: make dist
34+
4035
- uses: actions/upload-release-asset@v1
4136
if: github.event_name == 'release'
4237
env:

Diff for: .github/workflows/nightly.yaml

+3-22
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,13 @@ jobs:
1313
- name: checkout
1414
uses: actions/checkout@v3
1515

16-
- name: Setup PHP with Composer v1
16+
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
1919
php-version: '7.4'
20-
tools: composer:v1
21-
22-
- name: Authenticate npm
23-
env:
24-
COMPOSER_GITHUB_TOKEN: ${{ secrets.COMPOSER_GITHUB_TOKEN }}
25-
run: |
26-
npm config set "@leviy:registry" "https://npm.pkg.github.com" \
27-
&& npm config set "//npm.pkg.github.com/:_authToken" "$COMPOSER_GITHUB_TOKEN"
2820

2921
- name: Composer Install
30-
run: composer install --no-interaction --no-progress --no-ansi
31-
32-
- name: Npm Install
33-
run: npm install --silent --no-fund --no-audit
22+
uses: ramsey/composer-install@v2
3423

3524
- name: Test
3625
run: make static-analysis unit-tests acceptance-tests
@@ -41,18 +30,10 @@ jobs:
4130
- name: checkout
4231
uses: actions/checkout@v3
4332

44-
- name: Setup PHP with Composer v1
33+
- name: Setup PHP
4534
uses: shivammathur/setup-php@v2
4635
with:
4736
php-version: '7.4'
48-
tools: composer:v1
49-
50-
- name: Authenticate npm
51-
env:
52-
COMPOSER_GITHUB_TOKEN: ${{ secrets.COMPOSER_GITHUB_TOKEN }}
53-
run: |
54-
npm config set "@leviy:registry" "https://npm.pkg.github.com" \
55-
&& npm config set "//npm.pkg.github.com/:_authToken" "$COMPOSER_GITHUB_TOKEN"
5637

5738
- name: Security checks
5839
run: make security-tests

Diff for: .github/workflows/test.yaml

+8-48
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,25 @@ env:
55
COMPOSER_AUTH: ${{ secrets.COMPOSER_GITHUB_AUTH }}
66

77
jobs:
8-
test_php7-3:
8+
test:
99
runs-on: ubuntu-latest
10-
steps:
11-
- name: checkout
12-
uses: actions/checkout@v3
13-
14-
- name: Setup PHP with Composer v1
15-
uses: shivammathur/setup-php@v2
16-
with:
17-
php-version: '7.3'
18-
tools: composer:v1
19-
20-
- name: Get Composer Cache Directory
21-
id: composer-cache
22-
run: |
23-
echo "::set-output name=dir::$(composer config cache-files-dir)"
24-
- uses: actions/cache@v3
25-
with:
26-
path: ${{ steps.composer-cache.outputs.dir }}
27-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
28-
restore-keys: |
29-
${{ runner.os }}-composer-
30-
31-
- name: Composer Install
32-
run: composer install --no-interaction --no-progress --no-ansi
3310

34-
- name: Test
35-
run: make static-analysis unit-tests acceptance-tests coding-standards
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
php: [ 7.4, 8.0, 8.1 ]
3615

37-
- name: Integration tests
38-
run: |
39-
git config --global user.name "github-actions"
40-
git config --global user.email "[email protected]"
41-
make integration-tests
42-
test_php8:
43-
runs-on: ubuntu-latest
4416
steps:
4517
- name: checkout
4618
uses: actions/checkout@v3
4719

48-
- name: Setup PHP with Composer v1
20+
- name: Setup PHP
4921
uses: shivammathur/setup-php@v2
5022
with:
51-
php-version: '8.0'
52-
tools: composer:v1
53-
54-
- name: Get Composer Cache Directory
55-
id: composer-cache
56-
run: |
57-
echo "::set-output name=dir::$(composer config cache-files-dir)"
58-
- uses: actions/cache@v3
59-
with:
60-
path: ${{ steps.composer-cache.outputs.dir }}
61-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
62-
restore-keys: |
63-
${{ runner.os }}-composer-
23+
php-version: ${{ matrix.php }}
6424

6525
- name: Composer Install
66-
run: composer install --no-interaction --no-progress --no-ansi
26+
uses: ramsey/composer-install@v2
6727

6828
- name: Test
6929
run: make static-analysis unit-tests acceptance-tests coding-standards

Diff for: Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ coding-standards: vendor
3737
security-tests: vendor bin/local-security-checker
3838
bin/local-security-checker
3939

40-
security_checker_binary = local-php-security-checker_1.0.0_linux_amd64
40+
security_checker_binary = local-php-security-checker_2.0.6_linux_amd64
4141
ifeq ($(shell uname -s), Darwin)
42-
security_checker_binary = local-php-security-checker_1.0.0_darwin_amd64
42+
security_checker_binary = local-php-security-checker_2.0.6_darwin_amd64
4343
endif
4444

4545
bin/local-security-checker:
46-
curl -LS https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/$(security_checker_binary) -o bin/local-security-checker
46+
curl -LS https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.6/$(security_checker_binary) -o bin/local-security-checker
4747
chmod a+x bin/local-security-checker
4848

4949
bin/box.phar:
50-
curl -LS https://github.com/humbug/box/releases/download/3.14.0/box.phar -o bin/box.phar
50+
curl -LS https://github.com/humbug/box/releases/download/3.16.0/box.phar -o bin/box.phar
5151
chmod a+x bin/box.phar

Diff for: composer.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@
44
"description": "Command line tool for releasing new versions of a project",
55
"license": "MIT",
66
"require": {
7-
"php": "^7.3||^8.0",
7+
"php": "^7.4 || ^8.0, <8.2",
88
"beberlei/assert": "^3.2",
9+
"consolidation/self-update": "^2.0",
910
"guzzlehttp/guzzle": "^6.3",
10-
"padraic/phar-updater": "^1.0",
1111
"symfony/config": "^5.0",
1212
"symfony/console": "^5.0",
1313
"symfony/dependency-injection": "^5.0",
1414
"symfony/yaml": "^5.0"
1515
},
1616
"require-dev": {
17-
"behat/behat": "^3.4",
17+
"behat/behat": "^3.12",
1818
"leviy/coding-standard": "^4.0",
1919
"mockery/mockery": "^1.1",
20-
"phpstan/phpstan": "^0.12.14",
20+
"phpstan/phpstan": "^1.9",
2121
"phpunit/phpunit": "^9.0",
2222
"symfony/process": "^5.0"
2323
},
2424
"config": {
25-
"sort-packages": true
25+
"sort-packages": true,
26+
"allow-plugins": {
27+
"dealerdirect/phpcodesniffer-composer-installer": true
28+
}
2629
},
2730
"autoload": {
2831
"psr-4": {

0 commit comments

Comments
 (0)