Skip to content

Commit

Permalink
PHPStan integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 8, 2017
1 parent 0bf2d23 commit 6881bd4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ install:
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable; fi
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable --prefer-lowest; fi

script: vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.xml
script:
- vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.xml
- if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.5.2 && vendor/bin/phpstan analyse -c phpstan.neon -l 3 src tests; fi

after_success:
- if [[ $coverage = 'true' ]]; then bash <(curl -s https://codecov.io/bash); fi
Expand All @@ -55,10 +57,14 @@ matrix:
env: setup=lowest
- php: 7.0
env: setup=stable
- php: 7.0
env: PHPSTAN=1
- php: 7.1
env: setup=lowest
- php: 7.1
env: setup=stable
- php: 7.1
env: PHPSTAN=1
allow_failures:
- php: hhvm
fast_finish: true
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parameters:
ignoreErrors:
- '#Access to an undefined property#'
- '#Call to an undefined static method#'
- '#Property Carbon\\Carbon::\$timezone \(DateTimeZone\) does not accept string#'
- '#Property Carbon\\Carbon::\$tz \(DateTimeZone\) does not accept string#'
- '#Method Carbon\\Carbon::instance\(\) should return static\(Carbon\\Carbon\) but returns DateTime#'

0 comments on commit 6881bd4

Please sign in to comment.