Skip to content

Commit f1d27ab

Browse files
committed
More strict phpstan
1 parent 2c1b576 commit f1d27ab

5 files changed

Lines changed: 307 additions & 10 deletions

File tree

.github/workflows/php.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,25 @@ jobs:
108108

109109
- name: Codestyle
110110
run: composer run-script codestyle
111+
112+
dependencies:
113+
runs-on: ubuntu-latest
114+
115+
steps:
116+
- uses: actions/checkout@v2
117+
118+
- name: Setup PHP
119+
uses: shivammathur/setup-php@v2
120+
with:
121+
php-version: '8.5'
122+
env:
123+
update: true
124+
125+
- name: Validate composer.json and composer.lock
126+
run: composer validate
127+
128+
- name: Install dependencies
129+
run: composer install --prefer-dist --no-progress --no-suggest
130+
131+
- name: Codestyle
132+
run: composer run-script dependencies

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/*
22
build/*
33
vendor/*
4+
.phpunit.cache
45
.phpunit.result.cache

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
"require-dev": {
1919
"phpunit/phpunit": "^10.2",
2020
"infection/infection": "^0.29",
21-
"phpstan/phpstan": "^1.10",
21+
"phpstan/phpstan": "^2.0",
22+
"thecodingmachine/phpstan-safe-rule": "^1.4",
23+
"phpstan/phpstan-strict-rules": "^2.0",
24+
"phpstan/phpstan-deprecation-rules": "^2.0",
25+
"phpstan/extension-installer": "^1.4",
26+
"shipmonk/composer-dependency-analyser": "^1.8",
2227
"webthinx/codestyle": "^1.1"
2328
},
2429
"scripts": {
@@ -31,7 +36,8 @@
3136
"phpstan-next": "phpstan analyze --level max src",
3237
"phpstan-max": "phpstan analyze --level max src",
3338
"codestyle": "phpcs --extensions=php src tests",
34-
"codestyle-fix": "phpcbf --extensions=php src tests"
39+
"codestyle-fix": "phpcbf --extensions=php src tests",
40+
"dependencies": "composer-dependency-analyser"
3541
},
3642
"autoload": {
3743
"psr-4": {
@@ -46,7 +52,8 @@
4652
"config": {
4753
"allow-plugins": {
4854
"dealerdirect/phpcodesniffer-composer-installer": true,
49-
"infection/extension-installer": true
55+
"infection/extension-installer": true,
56+
"phpstan/extension-installer": true
5057
}
5158
}
5259
}

composer.lock

Lines changed: 273 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)