Skip to content

Instantly share code, notes, and snippets.

@thetwopct
Created January 19, 2023 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thetwopct/80082946287fb14ee31beeb1674c2dcc to your computer and use it in GitHub Desktop.
Save thetwopct/80082946287fb14ee31beeb1674c2dcc to your computer and use it in GitHub Desktop.
squizlabs / PHP_CodeSniffer (phpcs) inside Docker in VS Code
#!/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