Skip to content

Commit 174e832

Browse files
committed
Add php stan with run and apply fixes to conform to the requirements
1 parent f1b0b2e commit 174e832

7 files changed

+1541
-242
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ composer.phar
1010
/build/
1111
# Ignore local infection overrides.
1212
infection.json
13+
.phpunit.result.cache

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ script:
2222
- vendor/bin/phpcs --standard=PSR2 src
2323
- vendor/bin/phpcpd src tests
2424
- vendor/bin/phpunit --coverage-clover=coverage.xml
25+
- vendor/bin/phpstan analyse src tests
2526
- ./infection.phar --min-msi=48 --threads=4
2627

2728
# public repo on Travis CI (without token)

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ They will help you to write code with consistent style (quotation, indentation,
4545
* phpcpd
4646

4747

48+
### PHPstan ##
49+
50+
The PHP Static Analysis tool.
51+
52+
$ vendor/bin/phpstan analyse src tests
53+
54+
4855
### The best use
4956

5057
Install plugins to Sublime Text 3:

composer.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@
1212
"require": {
1313
},
1414
"require-dev": {
15-
"phpunit/phpunit": "^7.4",
15+
"phpstan/extension-installer": "^1.0",
16+
"phpstan/phpstan": "^0.11.16",
17+
"phpstan/phpstan-phpunit": "^0.11.2",
18+
"phpunit/phpunit": "^8.4",
1619
"sebastian/phpcpd": "^4.1",
17-
"squizlabs/php_codesniffer": "^3.3"
20+
"squizlabs/php_codesniffer": "^3.5"
1821
},
1922
"autoload": {
2023
"psr-4": {
2124
"App\\": "src/"
2225
}
2326
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"Tests\\": "tests/"
30+
}
31+
},
2432
"scripts-descriptions": {
2533
"phpcs": "Checks that the code conforms to coding standard",
2634
"phpcbf": "Checks and FIX the code to coding standard",
@@ -32,11 +40,13 @@
3240
"@composer validate --no-check-all --strict",
3341
"@phpcs",
3442
"@phpcpd",
43+
"@phpstan",
3544
"@test"
3645
],
3746
"phpcs": "phpcs --standard=PSR2 src",
3847
"phpcbf": "phpcbf --standard=PSR2 src tests",
3948
"phpcpd": "phpcpd src tests",
49+
"phpstan": "phpstan analyse --level=max src tests",
4050
"test": "phpunit"
4151
},
4252
"minimum-stability": "stable",
@@ -45,7 +55,7 @@
4555
"process-timeout": 0,
4656
"sort-packages": true,
4757
"platform": {
48-
"php": "7.2"
58+
"php": "7.3"
4959
}
5060
}
5161
}

0 commit comments

Comments
 (0)