Skip to content

Commit

Permalink
Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
tai-sho committed Jun 9, 2024
1 parent 275adf2 commit ba444d9
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 52 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ on:
types: [opened, synchronize, reopened]

jobs:
phpstan:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon

phpunit:
runs-on: ubuntu-latest

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"friendsofphp/php-cs-fixer": "^3.58"
"friendsofphp/php-cs-fixer": "^3.58",
"phpstan/phpstan": "^1.11"
},
"autoload": {
"psr-4": {
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 6
paths:
- src
- tests

Loading

0 comments on commit ba444d9

Please sign in to comment.