Make php 7.0 cs fixer

This commit is contained in:
Arnie
2018-11-19 19:31:44 +01:00
parent 9fc9241c47
commit 75be9aef27
5 changed files with 58 additions and 7 deletions
@@ -3,13 +3,18 @@
__phpFixer() {
local failed=0
local args=""
__msg "PHP-cs-fixer"
if [[ ${VERBOSE} -eq 1 ]]; then
args="${args} -vvv"
fi
# Cannot chain php files without specifying a config CS file :(
if [[ ${DRY_RUN} -eq 0 ]]; then
for file in "${PHP_FILES[@]}"; do
php-cs-fixer fix "${file}"
php-cs-fixer ${args} fix "${file}"
[[ $? -ne 0 ]] && failed=1
done
else
@@ -17,7 +22,7 @@ __phpFixer() {
local invalid_syntax=()
for file in "${PHP_FILES[@]}"; do
php-cs-fixer fix --dry-run "${file}"
php-cs-fixer ${args} fix --dry-run "${file}"
case $? in
0)
#all good
+4 -1
View File
@@ -11,7 +11,7 @@ PHP_FILES=()
DRY_RUN=0
VERBOSE=0
__initVariables() {
@@ -21,6 +21,9 @@ __initVariables() {
--dry-run)
DRY_RUN=1
;;
--verbose)
VERBOSE=1
;;
*.css|*.scss|*.sass|*.less)
__path_exists "${1}"
if [[ $? -ne 0 ]]; then