Skip to content

Commit 855270b

Browse files
committed
chore(lint): ➕ add PHPStan
1 parent 6da6d97 commit 855270b

4 files changed

Lines changed: 71 additions & 4 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"git",
66
"github",
77
"json",
8+
"lint",
89
"readme",
910
"response",
1011
"test"

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,10 @@ exec = docker run --tty --workdir "/app" --volume "./:/app" --user=$(shell id -u
66
install: # Install the project
77
$(exec) "composer install"
88

9+
check: test phpstan # Run PHPUnit and PHPStan
10+
911
test: # Run PHPUnit tests
1012
$(exec) "composer test"
13+
14+
phpstan: # Run PHPStan checks
15+
$(exec) "composer phpstan"

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"type": "library",
55
"license": "MIT",
66
"scripts": {
7-
"test": "@php vendor/bin/phpunit"
7+
"test": "@php vendor/bin/phpunit",
8+
"phpstan": "phpstan analyse --level 10 src"
89
},
910
"scripts-descriptions": {
10-
"test": "Run PHPUnit tests"
11+
"test": "Run PHPUnit tests",
12+
"phpstan": "Run PHPStan checks"
1113
},
1214
"autoload": {
1315
"psr-4": {
@@ -29,6 +31,7 @@
2931
"galbar/jsonpath": "^3.0"
3032
},
3133
"require-dev": {
32-
"nyholm/psr7": "^1.8"
34+
"nyholm/psr7": "^1.8",
35+
"phpstan/phpstan": "^2.1"
3336
}
3437
}

composer.lock

Lines changed: 59 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)