Skip to content

Instantly share code, notes, and snippets.

@josuecau
Created May 14, 2016 06:20
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 josuecau/0f09841abdd4b48abf58d557598a84fe to your computer and use it in GitHub Desktop.
Save josuecau/0f09841abdd4b48abf58d557598a84fe to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# Permet d'utiliser PHP-CS-Fixer en mode stdin/stdout,
# par exemple dans Vim avec `equalprg`
#
cmd=php-cs-fixer
hash "$cmd" 2>/dev/null || exit 1
tmp=$(mktemp)
tee > "$tmp"
"$cmd" "$@" --quiet fix "$tmp"
cat "$tmp"
rm "$tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment