Add/update a lot of documentation

This commit is contained in:
Michael Wolf
2023-09-30 20:38:00 -06:00
parent 87e15f87f3
commit eeee488dde
4 changed files with 353 additions and 20 deletions

36
examples/php Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
## This usually isn't necessary, but if you need to use wrflog this
## is how you get it:
# source "$WF_ROOT/_reformat-common.bash"
if [[ "$WOULD_REFORMAT" = "would_reformat" ]] ; then
set +e
out=$(php $DIR/.././vendor/bin/pint --test "$1")
retval="$?"
set -e
# unfortunately, pint doesn't distinguish between files with
# syntax errors and files that are merely misformatted
echo "$out"
exit "$retval"
fi
if [[ "$WOULD_REFORMAT" = "do_reformat" ]] ; then
set +e
out=$(php $DIR/.././vendor/bin/pint "$1")
retval="$?"
set -e
echo "$out"
exit "$retval"
fi
exit 255