Skip to content

Commit

Permalink
ci: Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Feb 18, 2023
1 parent 6682b23 commit 544844b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
- name: Run unit tests
run: composer test

- name: Run static analysis
run: composer phpstan

test-compiled:
runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.19 || ^3.8",
"phpstan/phpstan": "^1.9",
"psr/simple-cache": "^1 || ^2 || ^3",
"yoast/phpunit-polyfills": "^1.0.1"
},
Expand Down Expand Up @@ -60,6 +61,7 @@
"sort-packages": true
},
"scripts": {
"phpstan": "phpstan analyze --memory-limit 512M",
"test": "phpunit"
}
}
9 changes: 9 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
parameters:
level: 2

paths:
- src/

ignoreErrors:
# Not used since b2eb0134d53921e75f0fa70b1cf901ed82b988b1 but cannot be removed due to BC.
- '(Constructor of class SimplePie\\Enclosure has an unused parameter \$javascript\.)'

0 comments on commit 544844b

Please sign in to comment.