aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-11-29 16:07:39 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-11-29 16:07:39 +1300
commite762715f3e7f0e9e6f861509872b1b6a5e2fa9d3 (patch)
tree6d5eb76f8218b7bc92b7f3cc3d046e1d82006a1e /bin
parentMerge branch 'release/v7.21.0' into develop (diff)
downloaddotfiles-e762715f3e7f0e9e6f861509872b1b6a5e2fa9d3.tar.gz
dotfiles-e762715f3e7f0e9e6f861509872b1b6a5e2fa9d3.zip
Add phpcsff(1df)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/phpcsff.mi515
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/phpcsff.mi5 b/bin/phpcsff.mi5
new file mode 100755
index 00000000..ea05eaaa
--- /dev/null
+++ b/bin/phpcsff.mi5
@@ -0,0 +1,15 @@
+# Use php-cs-fixer as a source filter.
+self=phpcsff
+
+<%
+include(`include/mktd.m4')
+%>
+
+# Duplicate stdin into a file
+if ! command -v php-cs-fixer >/dev/null 2>&1 ; then
+ printf >&2 'php-cs-fixer: command not found\n'
+ exit 1
+fi
+cat -- "${@:--}" > "$td"/src.php
+php-cs-fixer fix -- "$td"/src.php
+cat -- "$td"/src.php