Skip to content

Commit

Permalink
ci: Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Mar 19, 2023
1 parent a14f8b0 commit 8bfc333
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
ini-values: error_reporting=-1, display_errors=On, log_errors_max_len=0
coverage: none
tools: none
# Not enabled on PHP ≥ 8.2 by default
extensions: xmlwriter

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
Expand All @@ -46,6 +48,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 @@ -32,6 +32,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.19 || ^3.8",
"mf2/mf2": "^0.5.0",
"phpstan/phpstan": "^1.9",
"psr/simple-cache": "^1 || ^2 || ^3",
"yoast/phpunit-polyfills": "^1.0.1"
},
Expand Down Expand Up @@ -61,6 +62,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 8bfc333

Please sign in to comment.