3 # Note that this isn't loaded in via composer because then composer can
4 # only be run with php7.0
5 if [ ! -f "$PHAN" ]; then
6 echo "The environment variable PHAN must point to the 'phan' file"
7 echo "in a checkout of https://github.com/etsy/phan.git"
13 # Root directory of project
14 export ROOT
="$(git rev-parse --show-toplevel)"
16 # Phan's issues directory
17 export ISSUES
="${ROOT}/tests/phan/issues"
19 # Go to the root of this git repo
22 # Get the current hash of HEAD
23 export REV
="$(git rev-parse HEAD)"
25 # Destination for issues found
26 export RUN
="${ISSUES}/issues-${REV}"
28 # Run the analysis, emitting output to the
31 --project-root-directory "$ROOT" \
32 --config-file "$ROOT/tests/phan/config.php" \
37 cat "${RUN}" | php
"$ROOT/tests/phan/bin/postprocess-phan.php" "${@}" > /tmp
/phan.$$
39 mv /tmp
/phan.$$
"${RUN}"
41 # Re-link the latest file
42 rm -f "${ISSUES}/latest"
43 ln -s "${RUN}" "${ISSUES}/latest"
45 # Output any issues that were found