1
0
Fork 0
mirror of https://github.com/archtechx/template.git synced 2025-12-12 13:24:03 +00:00

php-cs-fixer 3

This commit is contained in:
Samuel Štancl 2021-05-24 17:05:05 +02:00 committed by GitHub
parent 277b63ab32
commit 31db877574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

8
check
View file

@ -16,21 +16,21 @@ offer_run() {
exit 1
}
if (php-cs-fixer fix --dry-run --config=.php_cs.php > /dev/null 2>/dev/null); then
if (php-cs-fixer fix --dry-run --config=.php-cs-fixer.php > /dev/null 2>/dev/null); then
echo '✅ php-cs-fixer OK'
else
read -p "⚠️ php-cs-fixer found issues. Fix (Y/n)? " fix
case ${fix:0:1} in
n|N )
echo '❌ php-cs-fixer FAIL'
offer_run 'php-cs-fixer fix --config=.php_cs.php'
offer_run 'php-cs-fixer fix --config=.php-cs-fixer.php'
;;
* )
if (php-cs-fixer fix --config=.php_cs.php > /dev/null 2>/dev/null); then
if (php-cs-fixer fix --config=.php-cs-fixer.php > /dev/null 2>/dev/null); then
echo '✅ php-cs-fixer OK'
else
echo '❌ php-cs-fixer FAIL'
offer_run 'php-cs-fixer fix --config=.php_cs.php'
offer_run 'php-cs-fixer fix --config=.php-cs-fixer.php'
fi
;;
esac