Skip to content

Commit 4bfaba8

Browse files
committed
Remove downgrade hacks as CI4 requires PHP 8.1
1 parent b4386c6 commit 4bfaba8

9 files changed

+6
-225
lines changed

.gitattributes

-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
*.php text eol=lf
22

33
.github/ export-ignore
4-
bin/ export-ignore
54
tests/ export-ignore
65
.editorconfig export-ignore
76
.gitattributes export-ignore
87
.gitignore export-ignore
98
.php-cs-fixer.dist.php export-ignore
10-
src/ComposerJsonRewriter.php export-ignore
119
src/ComposerScripts.php export-ignore
1210
phpunit.dist.xml export-ignore
1311
phpstan.neon.dist export-ignore
1412
phpstan-baseline.php export-ignore
15-
rector-downgrade.php export-ignore

.github/workflows/release.yml

-77
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ on:
55
tags:
66
- '**'
77

8-
env:
9-
COMPOSER_ROOT_VERSION: '1.x-dev'
10-
DEFAULT_BRANCH: '1.x'
11-
TARGET_PHP_VERSION: '7.4'
12-
TARGET_PHP_VERSION_ID: 70400
13-
148
jobs:
159
build:
1610
name: Create a release
@@ -26,74 +20,3 @@ jobs:
2620
token: ${{ secrets.RELEASE_TOKEN }}
2721
draft: true
2822
prerelease: false
29-
30-
build_downgraded_release:
31-
name: Build release for lower PHP version
32-
runs-on: ubuntu-latest
33-
needs: build
34-
timeout-minutes: 10
35-
36-
permissions:
37-
# Give the default GITHUB_TOKEN write permission to commit and push the
38-
# added or changed files to the repository.
39-
contents: write
40-
41-
steps:
42-
- name: Checkout code
43-
uses: actions/checkout@v4
44-
45-
- name: Setup PHP 8.1
46-
uses: shivammathur/setup-php@v2
47-
with:
48-
php-version: '8.1'
49-
coverage: none
50-
env:
51-
COMPOSER_TOKEN: ${{ secrets.RELEASE_TOKEN }}
52-
53-
- name: Get branch name
54-
id: branch_name
55-
run: echo "BRANCH=build-downgrade-to-${{ env.TARGET_PHP_VERSION_ID }}" >> $GITHUB_OUTPUT
56-
57-
- name: Install dependencies
58-
run: composer update --ansi
59-
60-
- name: Downgrade src
61-
run: php bin/transform-source ${{ env.TARGET_PHP_VERSION_ID }}
62-
63-
- name: Run lint on src
64-
run: vendor/bin/parallel-lint src --colors --show-deprecated
65-
66-
- name: Get tag for downgraded release
67-
id: tag-downgraded
68-
run: echo "${{ format('DOWNGRADED_TAG={0}.{1}', github.ref_name, env.TARGET_PHP_VERSION_ID) }}" >> $GITHUB_OUTPUT
69-
70-
- name: Import GPG signing information
71-
uses: crazy-max/ghaction-import-gpg@v6
72-
with:
73-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
74-
passphrase: ${{ secrets.PASSPHRASE }}
75-
git_config_global: true
76-
git_user_signingkey: true
77-
git_commit_gpgsign: true
78-
git_tag_gpgsign: true
79-
80-
- name: Commit and tag
81-
uses: stefanzweifel/git-auto-commit-action@v5
82-
env:
83-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
84-
with:
85-
commit_message: 'Release PHPStan CodeIgniter to target PHP ${{ env.TARGET_PHP_VERSION }}'
86-
branch: ${{ steps.branch_name.outputs.BRANCH }}
87-
tagging_message: ${{ steps.tag-downgraded.outputs.DOWNGRADED_TAG }}
88-
commit_options: '--gpg-sign'
89-
commit_user_name: paulbalandan
90-
commit_user_email: [email protected]
91-
add_options: '-u'
92-
create_branch: true
93-
94-
- name: Delete local and remote branches
95-
run: |
96-
git switch ${{ env.DEFAULT_BRANCH }}
97-
git branch -D ${{ steps.branch_name.outputs.BRANCH }}
98-
git push origin -d ${{ steps.branch_name.outputs.BRANCH }}
99-
git branch -a

.github/workflows/test-phpunit.yml

+1-11
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ on:
2020
- 'composer.json'
2121
- 'phpunit.dist.xml'
2222

23-
env:
24-
TARGET_PHP_VERSION: '7.4'
25-
TARGET_PHP_VERSION_ID: 70400
26-
2723
jobs:
2824
extension-tests:
2925
name: PHPUnit Extension Tests [PHP ${{ matrix.php-version }}]
30-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-latest
3127

3228
strategy:
3329
fail-fast: false
@@ -66,11 +62,5 @@ jobs:
6662
- name: Install dependencies
6763
run: composer update --ansi
6864

69-
- name: Downgrade src
70-
run: php bin/transform-source ${{ env.TARGET_PHP_VERSION_ID }}
71-
72-
- name: Run lint on src
73-
run: vendor/bin/parallel-lint src --colors --show-deprecated
74-
7565
- name: Run Extension Tests
7666
run: vendor/bin/phpunit --no-coverage

.php-cs-fixer.dist.php

-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@
2020
$finder = Finder::create()
2121
->files()
2222
->in([
23-
__DIR__ . '/bin',
2423
__DIR__ . '/src',
2524
__DIR__ . '/tests',
2625
])
2726
->append([
2827
__FILE__,
29-
__DIR__ . '/bin/parse-php-version',
30-
__DIR__ . '/bin/transform-source',
3128
]);
3229

3330
$overrides = [

bin/rector-downgrade.php

-48
This file was deleted.

bin/transform-source

-26
This file was deleted.

composer.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,19 @@
2323
},
2424
"require": {
2525
"php": "^8.1",
26-
"codeigniter4/framework": "^4.4",
26+
"codeigniter4/framework": "^4.5",
2727
"phpstan/phpstan": "^2.0"
2828
},
2929
"require-dev": {
3030
"codeigniter/coding-standard": "^1.7",
3131
"codeigniter4/shield": "^1.0",
32-
"friendsofphp/php-cs-fixer": "^3.20",
33-
"nexusphp/cs-config": "^3.12",
34-
"php-parallel-lint/php-parallel-lint": "^1.3",
32+
"friendsofphp/php-cs-fixer": "^3.49",
33+
"nexusphp/cs-config": "^3.21",
3534
"phpstan/extension-installer": "^1.3",
3635
"phpstan/phpstan-deprecation-rules": "^2.0",
3736
"phpstan/phpstan-phpunit": "^2.0",
3837
"phpstan/phpstan-strict-rules": "^2.0",
39-
"phpunit/phpunit": "^10.2 || ^11.4",
40-
"rector/rector": "^2.0"
38+
"phpunit/phpunit": "^10.5 || ^11.4"
4139
},
4240
"conflict": {
4341
"codeigniter/framework": "*"

phpstan.neon.dist

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ includes:
44
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
55

66
parameters:
7-
level: 9
7+
level: 10
88
paths:
99
- src
1010
- tests
1111
excludePaths:
1212
analyseAndScan:
13-
- src/ComposerJsonRewriter.php
1413
- src/ComposerScripts.php
1514
- tests/*/data/*
1615
tmpDir: build/phpstan

src/ComposerJsonRewriter.php

-49
This file was deleted.

0 commit comments

Comments
 (0)