Created
January 19, 2023 08:39
-
-
Save thetwopct/80082946287fb14ee31beeb1674c2dcc to your computer and use it in GitHub Desktop.
squizlabs / PHP_CodeSniffer (phpcs) inside Docker in VS Code
This file contains 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
#!/usr/bin/env bash | |
# Place this file in your Docker apps vendor/bin. | |
# Use VS Code plugin - PHP Sniffer & Beautifier by Samuel Hilson | |
# Set executablePath for PHPCS to be ./vendor/bin/myphpcs | |
# If you also want PHPCBF, duplicate this file, change any references of phpcs to phpcbf and add the CBF executable path. | |
set -eo pipefail | |
main_exec() { | |
docker compose \ | |
exec \ | |
php \ | |
php \ | |
./vendor/bin/phpcs \ | |
"${@}" | |
} | |
main_exec "${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment