From 1c0bbeaee4dd2a768c4fad8cbc7f30e925e367fc Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 13 Mar 2021 09:15:47 -0500 Subject: [PATCH] Use vendor phpcs when available --- tests/check_coding_standards.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/check_coding_standards.sh b/tests/check_coding_standards.sh index 9022bbf..28fdb19 100755 --- a/tests/check_coding_standards.sh +++ b/tests/check_coding_standards.sh @@ -122,9 +122,16 @@ if [[ ! -z "${is_null}" ]]; then ((errors++)) fi +# Determine which phpcs to use. +if [[ -f "../vendor/bin/phpcs" ]]; then + phpcs_to_use="../vendor/bin/phpcs" +else + phpcs_to_use="phpcs" +fi + # Detect coding standard violations. -phpcs --version -phpcs \ +"${phpcs_to_use}" --version +"${phpcs_to_use}" \ --extensions="php" \ --ignore="*/vendor/*" \ --standard="ruleset.xml" \