Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Adding php static analysis #704

Merged
merged 6 commits into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
clean:
@rm -rf vendor composer.lock sendgrid-php.zip

php_version = `php -v | head -n 1 | cut -d " " -f 2`

install: clean
ifdef GIT_HUB_TOKEN
composer config -g github-oauth.github.com $(GIT_HUB_TOKEN)
Expand All @@ -21,6 +23,11 @@ test:
vendor/bin/phpunit test/unit --filter test*
vendor/bin/phpcs lib/*/*

ifeq ($(shell expr $(php_version) \>= 7.1), 1)
composer require --dev phpstan/phpstan
vendor/bin/phpstan analyse --no-progress --level 1 lib test
endif

test-integ: test
vendor/bin/phpunit test --filter test*

Expand Down