Skip to content

Commit d448465

Browse files
trowskikelunik
andcommitted
Upgrade to Psalm 6
Co-authored-by: Niklas Keller <me@kelunik.com>
1 parent 64a99d0 commit d448465

5 files changed

Lines changed: 33 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
include:
1212
- operating-system: 'ubuntu-latest'
1313
php-version: '8.1'
14+
psalm: 'skip'
1415

1516
- operating-system: 'ubuntu-latest'
1617
php-version: '8.2'
@@ -20,20 +21,16 @@ jobs:
2021

2122
- operating-system: 'ubuntu-latest'
2223
php-version: '8.4'
23-
static-analysis: none
24-
style-fix: none
2524

2625
- operating-system: 'ubuntu-latest'
2726
php-version: '8.5'
28-
static-analysis: none
29-
style-fix: none
3027

3128
- operating-system: 'windows-latest'
32-
php-version: '8.3'
29+
php-version: '8.5'
3330
job-description: 'on Windows'
3431

3532
- operating-system: 'macos-latest'
36-
php-version: '8.3'
33+
php-version: '8.5'
3734
job-description: 'on macOS'
3835

3936
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
@@ -69,6 +66,10 @@ jobs:
6966
composer-${{ runner.os }}-
7067
composer-
7168
69+
- name: Remove psalm/phar
70+
run: composer remove --no-update --dev psalm/phar
71+
if: matrix.psalm == 'skip'
72+
7273
- name: Install dependencies
7374
uses: nick-invision/retry@v2
7475
with:
@@ -84,7 +85,7 @@ jobs:
8485

8586
- name: Run static analysis
8687
run: vendor/bin/psalm.phar
87-
if: matrix.static-analysis != 'none'
88+
if: matrix.psalm != 'skip'
8889

8990
- name: Run style fixer
9091
env:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This package provides interfaces and classes shared by [`amphp/mysql`](https://g
66

77
- PHP 8.1+
88

9+
We require PHP 8.2+ for development due to the Psalm version we use, but still support PHP 8.1 at runtime. However, [PHP 8.1 no longer receives updates](https://www.php.net/supported-versions.php), so please upgrade to a newer version of PHP.
10+
911
## Versioning
1012

1113
`amphp/sql` follows the [semver](http://semver.org/) semantic versioning specification like all other `amphp` packages.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require-dev": {
1818
"amphp/php-cs-fixer-config": "^2",
1919
"phpunit/phpunit": "^9",
20-
"psalm/phar": "5.23"
20+
"psalm/phar": "6.15.1"
2121
},
2222
"autoload": {
2323
"psr-4": {

psalm.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,24 @@
1212
<directory name="vendor"/>
1313
</ignoreFiles>
1414
</projectFiles>
15+
16+
<issueHandlers>
17+
<ClassMustBeFinal>
18+
<errorLevel type="suppress">
19+
<directory name="src"/>
20+
</errorLevel>
21+
</ClassMustBeFinal>
22+
23+
<PossiblyUnusedMethod>
24+
<errorLevel type="suppress">
25+
<directory name="src"/>
26+
</errorLevel>
27+
</PossiblyUnusedMethod>
28+
29+
<UnusedClass>
30+
<errorLevel type="suppress">
31+
<directory name="src"/>
32+
</errorLevel>
33+
</UnusedClass>
34+
</issueHandlers>
1535
</psalm>

src/SqlTransactionIsolationLevel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ enum SqlTransactionIsolationLevel implements SqlTransactionIsolation
99
case Repeatable;
1010
case Serializable;
1111

12+
#[\Override]
1213
public function getLabel(): string
1314
{
1415
return match ($this) {
@@ -19,6 +20,7 @@ public function getLabel(): string
1920
};
2021
}
2122

23+
#[\Override]
2224
public function toSql(): string
2325
{
2426
return match ($this) {

0 commit comments

Comments
 (0)