You are here

php-static-analysis.sh in Realistic Dummy Content 3.x

#!/bin/bash
#
# Static analysis.
#
set -e

echo '=> Static analysis of code.'
echo 'If you are getting a false negative, use:'
echo ''
echo '// @phpstan-ignore-next-line'
# Doing this in several steps due to
# https://github.com/dcycle/docker-phpstan-drupal/issues/8
for FILE in \
  /var/www/html/modules/custom/realistic_dummy_content/api/src/Framework \
  /var/www/html/modules/custom/realistic_dummy_content/api/src/includes \
  /var/www/html/modules/custom/realistic_dummy_content/api/src/traits \
  /var/www/html/modules/custom/realistic_dummy_content/api/realistic_dummy_content_api.module
do
  docker run --rm \
    -v "$(pwd)":/var/www/html/modules/custom/realistic_dummy_content \
    dcycle/phpstan-drupal:2 \
    -c /var/www/html/modules/custom/realistic_dummy_content/scripts/lib/phpstan/phpstan.neon \
    "$FILE"
done

File

scripts/php-static-analysis.sh
View source
  1. #!/bin/bash
  2. #
  3. # Static analysis.
  4. #
  5. set -e
  6. echo '=> Static analysis of code.'
  7. echo 'If you are getting a false negative, use:'
  8. echo ''
  9. echo '// @phpstan-ignore-next-line'
  10. # Doing this in several steps due to
  11. # https://github.com/dcycle/docker-phpstan-drupal/issues/8
  12. for FILE in \
  13. /var/www/html/modules/custom/realistic_dummy_content/api/src/Framework \
  14. /var/www/html/modules/custom/realistic_dummy_content/api/src/includes \
  15. /var/www/html/modules/custom/realistic_dummy_content/api/src/traits \
  16. /var/www/html/modules/custom/realistic_dummy_content/api/realistic_dummy_content_api.module
  17. do
  18. docker run --rm \
  19. -v "$(pwd)":/var/www/html/modules/custom/realistic_dummy_content \
  20. dcycle/phpstan-drupal:2 \
  21. -c /var/www/html/modules/custom/realistic_dummy_content/scripts/lib/phpstan/phpstan.neon \
  22. "$FILE"
  23. done