Files
php-curl-class/tests/run_static_analysis_check_phpstan.sh
T
Zach Borboa 29cca2e48b Move some configs out of the root directory (#910)
* Move flake8 configuration out of root directory

* Move PHPStan configuration out of root directory
2025-01-12 12:39:31 -05:00

24 lines
543 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}"
source "set_vars.inc.sh"
# Run commands from the project root directory.
pushd ..
set -x
if [[ $(echo "${CI_PHP_VERSION} >= 7.4" | bc -l) -eq 1 ]]; then
vendor/bin/phpstan analyse --ansi --configuration="tests/phpstan.neon" .
if [[ "${?}" -ne 0 ]]; then
echo "Error: phpstan static analysis check failed"
errors+=("phpstan static analysis check failed")
fi
else
echo "Skipped running phpstan check"
fi
popd