From 100d5846d130ae548c13b1b544001af3a9b1d010 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 17 Feb 2020 21:26:22 +0545 Subject: [PATCH] Run phpstan in Travis --- .travis.yml | 18 ++++++++++++++++-- phpstan.neon | 6 ++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 phpstan.neon diff --git a/.travis.yml b/.travis.yml index 270d1dc..189f6f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..b3cbdbe --- /dev/null +++ b/phpstan.neon @@ -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