Make php 7.0 cs fixer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user