diff --git a/Makefile b/Makefile index 24e15e292b88..ff2bfd6ea321 100644 --- a/Makefile +++ b/Makefile @@ -384,8 +384,17 @@ vendor-bin/phan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phan/compo vendor-bin/phan/composer.lock: vendor-bin/phan/composer.json @echo phan composer.lock is not up to date. +# The first line of "php --version" output looks like: +# PHP 7.2.16-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:23:29) ( NTS ) +# We want the 2nd "word", then the first 2 numbers separated by the dot +PHP_MINOR_VERSION = $(shell php --version | head -n 1 | cut -d' ' -f2 | cut -d'.' -f1-2) + vendor-bin/phpstan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phpstan/composer.lock +ifeq "$(PHP_MINOR_VERSION)" "7.0" + @echo "phpstan is not supported on PHP 7.0 so it is not being installed" +else composer bin phpstan install --no-progress +endif vendor-bin/phpstan/composer.lock: vendor-bin/phpstan/composer.json @echo phpstan composer.lock is not up to date.