Skip to content

Commit 02c8288

Browse files
authored
chore: update workflow to support PHP 8.4 (#83)
* chore: update workflow to support PHP 8.4 * cs fix * view class updates for CI 4.6 compatibility * chore: generate phpstan baseline
1 parent 2ec7f64 commit 02c8288

20 files changed

+281
-53
lines changed

.github/workflows/deptrac.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
- 'depfile.yaml'
1919
- '.github/workflows/deptrac.yml'
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
build:
2326
name: Dependency Tracing
@@ -31,7 +34,7 @@ jobs:
3134
- name: Set up PHP
3235
uses: shivammathur/setup-php@v2
3336
with:
34-
php-version: '8.1'
37+
php-version: '8.2'
3538
extensions: intl, json, mbstring, xml
3639
coverage: none
3740
env:

.github/workflows/phpcpd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2
2929
with:
30-
php-version: '8.1'
30+
php-version: '8.2'
3131
tools: phpcpd
3232
extensions: dom, mbstring
3333
coverage: none
3434

3535
- name: Detect duplicate code
36-
run: phpcpd app/ tests/
36+
run: phpcpd src/

.github/workflows/phpcsfixer.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,22 @@ on:
1414
- '**.php'
1515
- '.github/workflows/phpcsfixer.yml'
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
permissions:
22+
contents: read
23+
1724
jobs:
1825
build:
19-
name: Coding Standards
26+
name: PHP ${{ matrix.php-versions }} Coding Standards
2027
runs-on: ubuntu-latest
21-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
28+
if: (! contains(github.event.head_commit.message, '[ci skip]'))
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
php-versions: ['8.1', '8.2', '8.4']
2233

2334
steps:
2435
- name: Checkout
@@ -27,7 +38,7 @@ jobs:
2738
- name: Set up PHP
2839
uses: shivammathur/setup-php@v2
2940
with:
30-
php-version: '8.1'
41+
php-version: ${{ matrix.php-versions }}
3142
extensions: json, tokenizer
3243
coverage: none
3344
env:
@@ -53,3 +64,5 @@ jobs:
5364
5465
- name: Check code for standards compliance
5566
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
67+
env:
68+
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-versions == '8.4' }}

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
php-versions: ['8.1', '8.2', '8.3']
29+
php-versions: ['8.1', '8.4']
3030

3131
steps:
3232
- name: Checkout

.github/workflows/phpunit.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,30 @@ on:
2020

2121
jobs:
2222
main:
23-
name: PHP ${{ matrix.php-versions }} Unit Tests
23+
name: PHP ${{ matrix.php-versions }}
2424
runs-on: ubuntu-latest
2525
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2626
strategy:
2727
matrix:
28-
php-versions: ['8.1', '8.2', '8.3']
28+
php-versions: ['8.1', '8.2', '8.3', '8.4']
2929

3030
steps:
31+
- name: Free Disk Space (Ubuntu)
32+
uses: jlumbroso/free-disk-space@main
33+
with:
34+
# this might remove tools that are actually needed,
35+
# if set to "true" but frees about 6 GB
36+
tool-cache: false
37+
38+
# all of these default to true, but feel free to set to
39+
# "false" if necessary for your workflow
40+
android: true
41+
dotnet: true
42+
haskell: true
43+
large-packages: false
44+
docker-images: true
45+
swap-storage: true
46+
3147
- name: Checkout
3248
uses: actions/checkout@v4
3349

@@ -65,7 +81,7 @@ jobs:
6581
TERM: xterm-256color
6682
TACHYCARDIA_MONITOR_GA: enabled
6783

68-
- if: matrix.php-versions == '8.0'
84+
- if: matrix.php-versions == '8.2'
6985
name: Run Coveralls
7086
continue-on-error: true
7187
run: |

.github/workflows/psalm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup PHP
3232
uses: shivammathur/setup-php@v2
3333
with:
34-
php-version: '8.1'
34+
php-version: '8.2'
3535
tools: phpstan, phpunit
3636
extensions: intl, json, mbstring, xml
3737
coverage: none

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
php-versions: ['8.1', '8.2', '8.3']
29+
php-versions: ['8.2', '8.4']
3030

3131
steps:
3232
- name: Checkout

phpstan-baseline.neon

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Call to an undefined method CodeIgniter\\View\\RendererInterface\:\:renderFragments\(\)\.$#'
5+
identifier: method.notFound
6+
count: 1
7+
path: src/Common.php
8+
9+
-
10+
message: '''
11+
#^Call to deprecated method __construct\(\) of class CodeIgniter\\HTTP\\Response\:
12+
4\.5\.0 The param \$config is no longer used\.$#
13+
'''
14+
identifier: method.deprecated
15+
count: 2
16+
path: src/Config/Services.php
17+
18+
-
19+
message: '#^Call to an undefined method CodeIgniter\\View\\RendererInterface\:\:parseFragments\(\)\.$#'
20+
identifier: method.notFound
21+
count: 1
22+
path: src/View/View.php
23+
24+
-
25+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertArrayHasKey\(\) with ''_ci_previous_url'' and non\-empty\-array will always evaluate to true\.$#'
26+
identifier: method.alreadyNarrowedType
27+
count: 2
28+
path: tests/CodeIgniterTest.php
29+
30+
-
31+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''https\://example\.com…'' and ''https\://example\.com…'' will always evaluate to false\.$#'
32+
identifier: method.impossibleType
33+
count: 1
34+
path: tests/CodeIgniterTest.php
35+
36+
-
37+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''https\://example\.com…'' and ''https\://example\.com…'' will always evaluate to true\.$#'
38+
identifier: method.alreadyNarrowedType
39+
count: 1
40+
path: tests/CodeIgniterTest.php
41+
42+
-
43+
message: '''
44+
#^Call to deprecated method __construct\(\) of class CodeIgniter\\HTTP\\Response\:
45+
4\.5\.0 The param \$config is no longer used\.$#
46+
'''
47+
identifier: method.deprecated
48+
count: 1
49+
path: tests/HTTP/RedirectResponseTest.php
50+
51+
-
52+
message: '''
53+
#^Call to deprecated method __construct\(\) of class CodeIgniter\\HTTP\\Response\:
54+
4\.5\.0 The param \$config is no longer used\.$#
55+
'''
56+
identifier: method.deprecated
57+
count: 1
58+
path: tests/HTTP/ResponseTest.php
59+
60+
-
61+
message: '#^Variable \$this might not be defined\.$#'
62+
identifier: variable.undefined
63+
count: 2
64+
path: tests/_support/Views/complex/include.php
65+
66+
-
67+
message: '#^Variable \$this might not be defined\.$#'
68+
identifier: variable.undefined
69+
count: 2
70+
path: tests/_support/Views/complex/layout.php
71+
72+
-
73+
message: '#^Variable \$this might not be defined\.$#'
74+
identifier: variable.undefined
75+
count: 5
76+
path: tests/_support/Views/complex/view1.php
77+
78+
-
79+
message: '#^Variable \$this might not be defined\.$#'
80+
identifier: variable.undefined
81+
count: 2
82+
path: tests/_support/Views/complex/view2.php
83+
84+
-
85+
message: '#^Variable \$this might not be defined\.$#'
86+
identifier: variable.undefined
87+
count: 2
88+
path: tests/_support/Views/complex/view3.php
89+
90+
-
91+
message: '#^Variable \$this might not be defined\.$#'
92+
identifier: variable.undefined
93+
count: 1
94+
path: tests/_support/Views/default_include.php
95+
96+
-
97+
message: '#^Variable \$this might not be defined\.$#'
98+
identifier: variable.undefined
99+
count: 2
100+
path: tests/_support/Views/huge/include.php
101+
102+
-
103+
message: '#^Variable \$this might not be defined\.$#'
104+
identifier: variable.undefined
105+
count: 4
106+
path: tests/_support/Views/huge/layout.php
107+
108+
-
109+
message: '#^Variable \$this might not be defined\.$#'
110+
identifier: variable.undefined
111+
count: 6
112+
path: tests/_support/Views/huge/view.php
113+
114+
-
115+
message: '#^Variable \$this might not be defined\.$#'
116+
identifier: variable.undefined
117+
count: 3
118+
path: tests/_support/Views/layout.php
119+
120+
-
121+
message: '#^Variable \$this might not be defined\.$#'
122+
identifier: variable.undefined
123+
count: 5
124+
path: tests/_support/Views/many/layout.php
125+
126+
-
127+
message: '#^Variable \$this might not be defined\.$#'
128+
identifier: variable.undefined
129+
count: 9
130+
path: tests/_support/Views/many/view1.php
131+
132+
-
133+
message: '#^Variable \$this might not be defined\.$#'
134+
identifier: variable.undefined
135+
count: 4
136+
path: tests/_support/Views/view_fragment.php
137+
138+
-
139+
message: '#^Variable \$this might not be defined\.$#'
140+
identifier: variable.undefined
141+
count: 1
142+
path: tests/_support/Views/view_fragment_error.php
143+
144+
-
145+
message: '#^Variable \$this might not be defined\.$#'
146+
identifier: variable.undefined
147+
count: 4
148+
path: tests/_support/Views/view_fragment_in_view_fragment.php
149+
150+
-
151+
message: '#^Variable \$this might not be defined\.$#'
152+
identifier: variable.undefined
153+
count: 2
154+
path: tests/_support/Views/view_included_2.php
155+
156+
-
157+
message: '#^Variable \$this might not be defined\.$#'
158+
identifier: variable.undefined
159+
count: 3
160+
path: tests/_support/Views/view_with_include_1.php
161+
162+
-
163+
message: '#^Variable \$this might not be defined\.$#'
164+
identifier: variable.undefined
165+
count: 3
166+
path: tests/_support/Views/view_with_include_2.php
167+
168+
-
169+
message: '#^Variable \$testString might not be defined\.$#'
170+
identifier: variable.undefined
171+
count: 1
172+
path: tests/_support/Views/with_decorator.php
173+
174+
-
175+
message: '#^Variable \$this might not be defined\.$#'
176+
identifier: variable.undefined
177+
count: 7
178+
path: tests/_support/Views/with_fragment.php
179+
180+
-
181+
message: '#^Variable \$testString might not be defined\.$#'
182+
identifier: variable.undefined
183+
count: 1
184+
path: tests/_support/Views/without_decorator.php

phpstan.neon.dist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
includes:
2+
- phpstan-baseline.neon
13
parameters:
24
tmpDir: build/phpstan
35
level: 5
@@ -10,10 +12,6 @@ parameters:
1012
- src/Debug/Toolbar.php
1113
- src/Views/*
1214
ignoreErrors:
13-
- '#Variable \$testString might not be defined.#'
14-
- '#Variable \$this might not be defined.#'
15-
- '#Call to an undefined method CodeIgniter\\View\\RendererInterface::renderFragments\(\).#'
16-
- '#Call to an undefined method CodeIgniter\\View\\RendererInterface::parseFragments\(\).#'
1715
universalObjectCratesClasses:
1816
- CodeIgniter\Entity
1917
- CodeIgniter\Entity\Entity

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
cacheDirectory="build/psalm/"
1010
findUnusedBaselineEntry="true"
1111
findUnusedCode="false"
12+
ensureOverrideAttribute="false"
1213
>
1314
<projectFiles>
1415
<directory name="src/" />

0 commit comments

Comments
 (0)