#!/bin/bash ## usage: bash cleanup-Squiz.Arrays.ArrayDeclaration.NoSpaceBeforeDoubleArrow.sh vi ## usage: bash cleanup-Squiz.Arrays.ArrayDeclaration.NoSpaceBeforeDoubleArrow.sh joe [ -n "$1" ] && EDITOR="$1" if [ -z "$EDITOR" ]; then echo "Please provide parameter 1 (editor). Example: vi, joe" exit 1 fi function edit_at_line() { local f="$1" local l="$2" $EDITOR +$l "$f" } echo Process cleanup for 'Squiz.Arrays.ArrayDeclaration.NoSpaceBeforeDoubleArrow' echo Number of lines: 3 echo Examples: 'Array ( [0] => Expected 1 space between \"\"type\"\" and double arrow; 0 found [1] => Expected 1 space between \"\"max_length\"\" and double arrow; 0 found [2] => Expected 1 space between \"\"error_code\"\" and double arrow; 0 found ) ' echo Press ENTER to begin read edit_at_line 'api/v3/utils.php' 1832 edit_at_line 'api/v3/utils.php' 1852 edit_at_line 'api/v3/utils.php' 1910