diff --git a/.gitignore b/.gitignore index 9ffcf6f89..db88f6676 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Ignore build files +build/* + # Mac OS X dumps these all over the place. .DS_Store @@ -22,3 +25,7 @@ clover.xml # Ignore PHPStan local config .phpstan.neon + +# Ignore phpDocumentor's local config and artifacts +.phpdoc/* +phpdoc.xml diff --git a/.travis.yml b/.travis.yml index e519019e4..cdc912220 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,7 +62,7 @@ before_install: script: - ./build.php ${AUTOLOAD} - - ./vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no . + - make fmtcheck - if [[ `php -r "echo \version_compare(PHP_VERSION, '7.1', '>=');"` && $AUTOLOAD == 1 ]]; then make phpstan; fi after_script: ./vendor/bin/php-coveralls -v diff --git a/Makefile b/Makefile index 0abe37591..f8d43eb79 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,17 @@ +export PHPDOCUMENTOR_VERSION := v3.0.0-rc export PHPSTAN_VERSION := 0.12.8 vendor: composer.json composer install + +vendor/bin/phpstan: vendor curl -sfL https://github.com/phpstan/phpstan/releases/download/$(PHPSTAN_VERSION)/phpstan.phar -o vendor/bin/phpstan chmod +x vendor/bin/phpstan +vendor/bin/phpdoc: vendor + curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/$(PHPDOCUMENTOR_VERSION)/phpDocumentor.phar -o vendor/bin/phpdoc + chmod +x vendor/bin/phpdoc + test: vendor vendor/bin/phpunit .PHONY: test @@ -13,10 +20,17 @@ fmt: vendor vendor/bin/php-cs-fixer fix -v --using-cache=no . .PHONY: fmt -phpstan: vendor +fmtcheck: vendor + vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no . +.PHONY: fmtcheck + +phpdoc: vendor/bin/phpdoc + vendor/bin/phpdoc + +phpstan: vendor/bin/phpstan vendor/bin/phpstan analyse lib tests .PHONY: phpstan -phpstan-baseline: vendor +phpstan-baseline: vendor/bin/phpstan vendor/bin/phpstan analyse --error-format baselineNeon lib tests > phpstan-baseline.neon .PHONY: phpstan-baseline diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml new file mode 100644 index 000000000..b1ea92fad --- /dev/null +++ b/phpdoc.dist.xml @@ -0,0 +1,31 @@ + + + + build/phpdoc + + + latest + + + lib + + api + + + php + + stripe-php + + +