Skip to content

Commit

Permalink
Static analysis with PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 30, 2016
1 parent 358b255 commit 7963286
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Expand Up @@ -36,6 +36,12 @@ matrix:
- php: 7.0
env: PHPCS=1 DEFAULT=0

- php: 7.0
env: PHPSTAN=1 DEFAULT=0

- php: 7.1
env: PHPSTAN=1 DEFAULT=0

- php: hhvm
env: HHVM=1 DB=sqlite db_dsn='sqlite:///:memory:'

Expand All @@ -44,6 +50,10 @@ matrix:

allow_failures:
- php: hhvm
- php: 7.0
env: PHPSTAN=1 DEFAULT=0
- php: 7.1
env: PHPSTAN=1 DEFAULT=0

before_install:
- if [ $HHVM != 1 && $TRAVIS_PHP_VERSION != 7.* ]; then phpenv config-rm xdebug.ini; fi
Expand Down Expand Up @@ -78,6 +88,7 @@ script:
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.0 ]]; then vendor/bin/phpunit; fi

- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
- if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:dev-master && vendor/bin/phpstan analyse -c phpstan.neon -l 0 src; fi

after_success:
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then bash <(curl -s https://codecov.io/bash); fi
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
@@ -0,0 +1,3 @@
parameters:
autoload_files:
- %rootDir%/../../../src/basics.php

0 comments on commit 7963286

Please sign in to comment.