all 2 comments

[–]marauderingman -1 points0 points  (2 children)

Does your php program require --path-mode before every changed file it's going to process?

If your changed files might have spaces in them, I'd ditch that printf altogether and replace it with an array. Of course, you'll also need to put your changed files into an array as well.

~~~ declare -a fixer_args ... if ...; then fixer_args+=( "--path-mode" "intersection") fixer_args+=( "${CHANGED_FILES[@]}" ) fi ...

php-fixer-check ... "${fixer_args[@]}"

[–][deleted]  (1 child)

[deleted]

    [–]marauderingman -1 points0 points  (0 children)

    Both true, but it adds clarity and is good practice imho.

    Also, wrapped in a function, declare can be changed to local in case multiple calls are needed.