Last active
July 26, 2024 21:00
-
-
Save franckweb/ab509b57c2be8de9f74d9276c7ffbd07 to your computer and use it in GitHub Desktop.
PHP compatibility check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PHP COMPATIBILITY CHECK | |
# PHP CODE SNIFFER (with compatibility 7.4) | |
docker run --rm -v $(pwd):/app vfac/php7compatibility 7.4 [folder or file path] --extensions=php --ignore=vendor | |
# ------- | |
# PHPSTAN (with .neon configs) | |
docker run --rm -v $(pwd):/app ghcr.io/phpstan/phpstan analyse -c myfolder/phpstan.neon myfiles/*.phptxt > mylogs/mylog.log | |
# phpstan.configs.neon | |
parameters: | |
level: 8 # 1-8 levels | |
phpVersion: 70400 # PHP 7.4 | |
# ------- | |
# PHAN (with .phan/config.php) | |
# 1. Generate .phan/config.php with following command and customize extensions, directory, analysis level, etc. | |
docker run -v $PWD:/mnt/src --rm -u "$(id -u):$(id -g)" phanphp/phan:latest --init --init-level=5 --init-no-composer --init-analyze-dir=my/scripts/directory | |
# 2. docker run -v $PWD:/mnt/src --rm -u "$(id -u):$(id -g)" phanphp/phan:latest -po mylog.txt | |
# -------- | |
# RECTOR | |
# Analyze current directory(".") | |
docker run --init -it --rm -v "$(pwd):/project" -v "$(pwd)/tmp-phpqa:/tmp" -w /project jakzal/phpqa rector process . --dry-run --config rector.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment