Skip to content

Commit

Permalink
PHPStan: set the phpVersion
Browse files Browse the repository at this point in the history
* 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, though as long as the max PHPUnit version is PHPUnit 7.5, this _will_ throw deprecation notices, so let's leave that for now.

Includes minor update to the config for something which is no longer needed.
  • Loading branch information
jrfnl committed Nov 10, 2023
1 parent bf77e4f commit 38291f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:

jobs:
phpstan:
name: "PHP: 7.4 | PHPStan"
name: "PHPStan"

runs-on: "ubuntu-latest"

Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
parameters:
phpVersion: 70100 # Should be 50400, but PHPStan only accepts 70100 or higher...
level: 0
paths:
- src
Expand All @@ -8,7 +9,7 @@ parameters:
-
count: 1
message: '~^Undefined variable: \$phpCodeSnifferConfig$~'
path: %currentWorkingDirectory%/src/Config.php
path: src/Config.php

dynamicConstantNames:
- PHP_CODESNIFFER_IN_TESTS
Expand Down

0 comments on commit 38291f6

Please sign in to comment.