From 2735c77e679c7dac5c19ab410a1d34cfbc41bdaf Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 16 Dec 2023 08:01:52 -0500 Subject: [PATCH] auto install phpstan if not installed by using composer. --- static_tests.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static_tests.sh b/static_tests.sh index 182b422..a8ace00 100755 --- a/static_tests.sh +++ b/static_tests.sh @@ -1,6 +1,11 @@ #!/bin/bash if [ ! -x vendor/bin/phpstan ]; then - composer require --dev phpstan/phpstan + if which composer >/dev/null 2>&1; then + echo "Running Composer to install phpstan." + composer require --dev phpstan/phpstan + else + echo "Please install php composer!" + fi fi -./vendor/bin/phpstan analyse +./vendor/bin/phpstan analyse \ No newline at end of file