Skip to content

Commit e901eb0

Browse files
committed
PHPStan: set the phpVersion
* Set the `phpVersion` to `70100` (lowest possible). This prevents PHPStan throwing notices which are related to the PHP version on which PHPStan is being _run_, in contrast to the PHP version which the code _supports_. * With the `phpVersion` being set, PHPStan can now run on the `latest` PHP version in CI. Includes minor update to the config for something which is no longer needed.
1 parent cdbdb00 commit e901eb0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919

2020
jobs:
2121
phpstan:
22-
name: "PHP: 7.4 | PHPStan"
22+
name: "PHPStan"
2323

2424
runs-on: "ubuntu-latest"
2525

@@ -30,7 +30,7 @@ jobs:
3030
- name: Install PHP
3131
uses: shivammathur/setup-php@v2
3232
with:
33-
php-version: '7.4'
33+
php-version: 'latest'
3434
coverage: none
3535
tools: phpstan
3636

phpstan.neon.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
parameters:
2+
phpVersion: 70100 # Should be 50400, but PHPStan only accepts 70100 or higher...
23
level: 0
34
paths:
45
- src
@@ -8,7 +9,7 @@ parameters:
89
-
910
count: 1
1011
message: '~^Undefined variable: \$phpCodeSnifferConfig$~'
11-
path: %currentWorkingDirectory%/src/Config.php
12+
path: src/Config.php
1213

1314
dynamicConstantNames:
1415
- PHP_CODESNIFFER_IN_TESTS

0 commit comments

Comments
 (0)