Files
php-curl-class/tests/run_syntax_check.sh
T
Zach Borboa 87fc9b3796 Use separate scripts to ci tests (#907)
* Run ci static analysis checks using scripts

* Clean up

* Move phpunit run to dedicated script

* Use run.sh and remove ci.sh

* Rename test scripts to be prefixed with "run_"

* Move static analysis runs to test script

* Clean up
2025-01-10 21:44:05 -05:00

17 lines
471 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}"
# Run commands from the project root directory.
pushd ..
# Check syntax in php files. Use `xargs' over `find -exec' as xargs exits with a value of 1 when any command errors.
find . -type "f" -iname "*.php" ! -path "*/vendor/*" | xargs -L "1" php -l
if [[ "${?}" -ne 0 ]]; then
echo "Error: php syntax checks failed"
errors+=("php syntax checks failed")
fi
popd