Skip to content

Commit

Permalink
Exclude unit tests from Phpstan
Browse files Browse the repository at this point in the history
Main reason is that Phpstan does not respect phpunit methods like:
`markTestSkipped()` and `markTestIncomplete()`.

Since tests is pseudo code/tooling I choose to take the approach to skip
Phpstan scanning in out unit tests.

Read more here:
phpstan/phpstan-phpunit#52 (comment)
  • Loading branch information
spaceo committed May 7, 2024
1 parent feb6863 commit 08ef0e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ parameters:
- web/modules/custom
- web/profiles/dpl_cms
- web/themes/custom
excludePaths:
- **/tests/src/Unit/*
ignoreErrors:
- '#Unsafe usage of new static\(\).#'
# Drupal Form API makes extensive use for arrays which we cannot provide
Expand Down

0 comments on commit 08ef0e9

Please sign in to comment.