blob: d304da3fbb58b14572f830a2574d0d11a8e27097 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
export PATH=vendor/bin:$PATH
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [[ $# -eq 1 ]]
then
RUNDIR=$@
else
RUNDIR=$(cd $DIR && cd ../ && pwd)/src
fi
RESULT=$(phpcs --colors --standard=PSR1,PSR2 $RUNDIR)
echo "$RESULT"
echo $RESULT | grep "PHPCBF CAN FIX" > /dev/null
if [[ $? -eq 0 ]]
then
printf "Would you like to fix errors? [Y/n] "
read answer
if [[ $answer != "n" ]]
then
echo "Running phpcbf: "
phpcbf --standard=PSR1,PSR2 $RUNDIR
fi
fi
echo "Running php-cs-fixer: "
php-cs-fixer fix $RUNDIR --level=psr2
|