Run phpstan in Travis

This commit is contained in:
Phil Davis 2020-02-17 21:26:22 +05:45
parent 5dca09c0cb
commit 100d5846d1
No known key found for this signature in database
GPG key ID: CB0E2267D5181F47
2 changed files with 22 additions and 2 deletions

View file

@ -11,10 +11,23 @@ matrix:
fast_finish: true
env:
global:
- RUN_PHPSTAN="FALSE"
matrix:
- PREFER_LOWEST=""
- PREFER_LOWEST="--prefer-lowest"
install:
- if [ $RUN_PHPSTAN == "TRUE" ]; then composer require --dev phpstan/phpstan:^0.12; fi
matrix:
include:
- name: 'PHPStan'
php: 7.4
env:
- RUN_PHPSTAN="TRUE"
fast_finish: true
services:
- mysql
@ -27,8 +40,9 @@ before_script:
- composer update $PREFER_LOWEST
script:
- find Core -name "*.php" | xargs -n1 php -l
- ./vendor/bin/sabre-cs-fixer fix . --dry-run --diff
- if [ $RUN_PHPSTAN == "FALSE" ]; then find Core -name "*.php" | xargs -n1 php -l; fi
- if [ $RUN_PHPSTAN == "FALSE" ]; then ./vendor/bin/sabre-cs-fixer fix . --dry-run --diff; fi
- if [ $RUN_PHPSTAN == "TRUE" ]; then php vendor/bin/phpstan.phar analyse Core html; fi
cache:
directories:

6
phpstan.neon Normal file
View file

@ -0,0 +1,6 @@
parameters:
level: 0
excludes_analyse:
- Core/Frameworks/BaikalAdmin/Resources/GlyphiconsPro/generate-sprite.php
- Core/Resources/Web/BaikalAdmin/GlyphiconsPro/generate-sprite.php
- html/res/core/BaikalAdmin/GlyphiconsPro/generate-sprite.php