diff --git a/.travis.yml b/.travis.yml index 60ba654..3157d68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: install: # remove packages with PHP requirements higher than 7.0 to prevent composer trying to resolve these, see: https://github.com/composer/composer/issues/6011 - - composer remove friendsofphp/php-cs-fixer --dev --no-update --no-interaction + - composer remove vimeo/psalm friendsofphp/php-cs-fixer --dev --no-update --no-interaction - composer install --prefer-dist --no-interaction --no-progress script: composer test-units @@ -42,6 +42,7 @@ jobs: install: composer install --prefer-dist --no-interaction --no-progress script: - '[ -z "$TRAVIS_TAG" ] || [ "$TRAVIS_TAG" == "$(php -r "require(\"vendor/autoload.php\"); echo Erusev\Parsedown\Parsedown::version;")" ]' + - composer test-static - composer test-formatting - stage: Test CommonMark (weak) diff --git a/composer.json b/composer.json index 2f1b735..bde1331 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ }, "require-dev": { "phpunit/phpunit": "^7.4|^6.5.13|^5.7.27|^4.8.36", + "vimeo/psalm": "^3.0", "friendsofphp/php-cs-fixer": "^2.13" }, "autoload": { @@ -28,9 +29,12 @@ }, "scripts": { "test": [ + "@test-static", "@test-units", "@test-formatting" ], + "test-static": "vendor/bin/psalm", + "test-dead-code": "vendor/bin/psalm --find-dead-code", "test-units": "vendor/bin/phpunit", "test-commonmark-weak": "vendor/bin/phpunit tests/CommonMarkTestWeak.php", "test-formatting": "@composer fix -- --dry-run", diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..5155a17 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,13 @@ + + + + + + + + +