Files
php-curl-class/tests/run_syntax_check.sh
T
Zach Borboa 58962a054e Fix PHPStan static analysis errors (#929)
* Increase PHPStan memory limit on local development

* Add emjois to test warnings and test errors

* Fix PHPStan static analysis errors

Error messages:
 ------ ------------------------------------------------------------------------------------------------------
  Line   src/Curl/Curl.php
 ------ ------------------------------------------------------------------------------------------------------
  123    Cannot unset property Curl\Curl::$curlErrorCodeConstant because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  124    Cannot unset property Curl\Curl::$curlErrorCodeConstants because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  125    Cannot unset property Curl\Curl::$curlOptionCodeConstants because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  126    Cannot unset property Curl\Curl::$effectiveUrl because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  127    Cannot unset property Curl\Curl::$rfc2616 because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  128    Cannot unset property Curl\Curl::$rfc6265 because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  129    Cannot unset property Curl\Curl::$totalTime because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  564    Cannot unset property Curl\Curl::$curlErrorCodeConstant because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  565    Cannot unset property Curl\Curl::$effectiveUrl because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
  566    Cannot unset property Curl\Curl::$totalTime because it might have hooks in a subclass.
         🪪  unset.possiblyHookedProperty
 ------ ------------------------------------------------------------------------------------------------------
2025-03-08 08:34:45 -05:00

17 lines
475 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