Skip to content

Commit

Permalink
phpstan integration
Browse files Browse the repository at this point in the history
  • Loading branch information
desperado committed Apr 12, 2019
1 parent ff68d0a commit 9047781
Show file tree
Hide file tree
Showing 6 changed files with 785 additions and 27 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -29,6 +29,7 @@ install:
script:
- ./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-clover=coverage.clover
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then ./vendor/bin/psalm --config=psalm.xml; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then ./vendor/bin/phpstan analyse src --level 7; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run; fi

after_script:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -22,9 +22,9 @@ For a simple check of the code standard, there is a command:
composer cs-check
```
## Static analysis
To improve the quality of the code used static analysis (via `psalm`). You can start it with the command:
To improve the quality of the code used static analysis (via `psalm` and `phpstan`). You can start it with the command:
```bash
composer psalm
composer psalm && composer phpstan
```
## Running the tests
The following tests must pass before we will accept a pull request. If any of these do not pass, it will result in a complete build failure.
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Expand Up @@ -67,17 +67,19 @@
"php-service-bus/module-phpinnacle-transport": "^v3.2",
"kelunik/loop-block": "^1.0",
"phpunit/phpunit": "^8",
"vimeo/psalm": "^v3"
"vimeo/psalm": "^v3",
"phpstan/phpstan": "^0.11.5"
},
"prefer-stable": true,
"minimum-stability": "stable",
"scripts": {
"psalm": "./vendor/bin/psalm --config=psalm.xml",
"phpstan": "./vendor/bin/phpstan analyse src --level 7",
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose",
"coverage": "./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose",
"cs-check": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
"cs-fix": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 7 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
},
"config": {
"optimize-autoloader": true
Expand Down

0 comments on commit 9047781

Please sign in to comment.