Skip to content

Commit 1c6d57c

Browse files
Run phpstan
1 parent c973c66 commit 1c6d57c

File tree

8 files changed

+67
-2
lines changed

8 files changed

+67
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.gitignore export-ignore
77
CHANGELOG.md export-ignore
88
phpcs.xml.dist export-ignore
9+
phpstan.neon.dist export-ignore
910
phpunit.xml.dist export-ignore
1011
README.md export-ignore
1112

.github/workflows/static.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,44 @@ jobs:
2727
max_attempts: 5
2828
command: composer update --no-interaction --no-progress
2929

30+
- name: Install PHP CodeSniffer
31+
uses: nick-invision/retry@v1
32+
with:
33+
timeout_minutes: 5
34+
max_attempts: 5
35+
command: composer bin phpcs update --no-interaction --no-progress
36+
3037
- name: Execute PHP CodeSniffer
3138
run: vendor/bin/phpcs
39+
40+
phpstan:
41+
name: PHPStan
42+
runs-on: ubuntu-20.04
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v2
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: '7.4'
52+
tools: composer:v2
53+
coverage: none
54+
55+
- name: Install Dependencies
56+
uses: nick-invision/retry@v1
57+
with:
58+
timeout_minutes: 5
59+
max_attempts: 5
60+
command: composer update --no-interaction --no-progress
61+
62+
- name: Install PHPStan
63+
uses: nick-invision/retry@v1
64+
with:
65+
timeout_minutes: 5
66+
max_attempts: 5
67+
command: composer bin phpstan update --no-interaction --no-progress
68+
69+
- name: Execute PHPStan
70+
run: vendor/bin/phpstan analyze --no-progress

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
composer.lock
22
phpcs.xml
3+
phpstan.neon
34
phpunit.xml
4-
/vendor
5+
vendor

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
install:
22
composer update
3+
composer bin all update
34

45
test:
56
vendor/bin/phpunit
7+
vendor/bin/phpstan analyze
68
vendor/bin/phpcs
79

810
fix:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"wrench/wrench": "^2.0"
2525
},
2626
"require-dev":{
27+
"bamarni/composer-bin-plugin": "^1.4.1",
2728
"phpunit/phpunit": "^6.5.14",
28-
"squizlabs/php_codesniffer": "^3.5.8",
2929
"symfony/var-dumper": "^3.3|^4.0|^5.0"
3030
},
3131
"autoload":{

phpstan.neon.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 1
3+
4+
paths:
5+
- src
6+
- tests

vendor-bin/phpcs/composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"require": {
3+
"squizlabs/php_codesniffer": "3.5.8"
4+
},
5+
"config": {
6+
"preferred-install": "dist"
7+
}
8+
}

vendor-bin/phpstan/composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"require": {
3+
"phpstan/phpstan": "0.12.59"
4+
},
5+
"config": {
6+
"preferred-install": "dist"
7+
}
8+
}

0 commit comments

Comments
 (0)