Skip to content

Commit

Permalink
PHPStan 2.0: update configuration
Browse files Browse the repository at this point in the history
PHPStan 2.0 has been released 🎉

This commit updates the PHPStan configuration file for use with PHPStan 2.0 and switches the workflow to start using PHPStan 2.0.

Refs:
* https://phpstan.org/blog/phpstan-2-0-released-level-10-elephpants
* https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md
* https://github.com/phpstan/phpstan/releases/tag/2.0.0
  • Loading branch information
jrfnl committed Dec 8, 2024
1 parent 36f2d3f commit 7b04c62
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
php-version: '7.4'
coverage: none
tools: phpstan:1.x
tools: phpstan:2.x

# Install dependencies and handle caching in one go.
# Dependencies need to be installed to make sure the PHPUnit classes are recognized.
Expand Down
15 changes: 15 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ parameters:
- src/Polyfills/AssertClosedResource.php

ignoreErrors:
# Level 4
# This is part of the functionality of this package. Safe to ignore.
-
message: "`^Call to function method_exists\\(\\) with '\\W+PHPUnit\\W+Framework…' and '(assert|expect|equalTo)[^']+' will always evaluate to true\\.$`"
count: 15
path: phpunitpolyfills-autoload.php

# The traits are functionality, but not used by the package itself. Can't be helped.
-
identifier: trait.unused
path: src/TestListeners/TestListenerDefaultImplementationPHPUnitLte5.php
-
identifier: trait.unused
path: src/TestListeners/TestListenerSnakeCaseMethods.php

# Level 5
-
# False positive, a string callback is perfectly fine, especially for static methods.
Expand Down

0 comments on commit 7b04c62

Please sign in to comment.