#!/bin/bash ## usage: bash batch-3.sh.txt #[ -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" } function ask_continue() { local line="" while [ "$line" != "y" -a "$line" != "n" ]; do echo -n "$1 (Y/n) " read line if [ -z "$line" ]; then line=y fi done if [ "$line" == "y" ]; then return 0 else return 1 fi } echo 'Welcome and thanks for helping with the cleanup!' echo '' echo 'This script will walk through a series of code-style issues in Civi'\''s PHP code.' echo 'For each issue, it will show a summary of the issue (ie how many files are' echo 'affected, how many lines of code are affected, and what detailed messages' echo 'are available about the issues.' echo '' echo 'The script will open the first file at the offending line so that you can fix' echo 'it. Please save, edit, close. The script will then repeat -- re-opening the text' echo 'editor at each offending line.' echo '' echo 'The script should generally open on the exact line with the problem; however,' echo 'if other changes were recently made to the file, then the line numbers may be' echo 'slightly off - if you don'\''t see a problem, then check the neighboring lines.' ask_continue 'Continue?' || exit echo '' echo 'What text editor would you prefer to use? [vi, emacs, joe]?' read EDITOR echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.Incorrect' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 4 spaces, found 6 ) ' echo 'Lines:Array ( [0] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1430 [1] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1448 [2] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1461 [3] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1467 [4] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1482 [5] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1495 [6] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1501 [7] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1526 [8] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1532 [9] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1538 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1430 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1448 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1461 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1467 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1482 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1495 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1501 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1526 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1532 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1538 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.Incorrect!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.IncorrectExact' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 6 spaces, found 8 [1] => Line indented incorrectly; expected 8 spaces, found 10 ) ' echo 'Lines:Array ( [0] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1431 [1] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1436 [2] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1437 [3] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1449 [4] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1455 [5] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1456 [6] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1462 [7] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1468 [8] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1483 [9] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1489 [10] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1490 [11] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1496 [12] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1502 [13] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1527 [14] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1533 [15] => tests/phpunit/CRM/Contact/BAO/ContactTest.php:1539 [16] => CRM/Utils/Token.php:250 [17] => CRM/Utils/Token.php:432 [18] => CRM/Utils/Token.php:571 [19] => CRM/Utils/Token.php:674 [20] => CRM/Utils/Token.php:800 [21] => CRM/Utils/Token.php:1529 [22] => CRM/Utils/Token.php:1644 ) ' echo '' echo 'Total number of edits to perform: 23' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1431 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1436 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1437 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1449 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1455 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1456 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1462 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1468 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1483 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1489 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1490 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1496 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1502 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1527 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1533 edit_at_line 'tests/phpunit/CRM/Contact/BAO/ContactTest.php' 1539 edit_at_line 'CRM/Utils/Token.php' 250 edit_at_line 'CRM/Utils/Token.php' 432 edit_at_line 'CRM/Utils/Token.php' 571 edit_at_line 'CRM/Utils/Token.php' 674 edit_at_line 'CRM/Utils/Token.php' 800 edit_at_line 'CRM/Utils/Token.php' 1529 edit_at_line 'CRM/Utils/Token.php' 1644 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.DocComment.ContentAfterOpen' echo 'Messages:Array ( [0] => The open comment tag must be the only content on the line ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/SyntaxConformanceTest.php:50 [1] => tests/phpunit/api/v3/SyntaxConformanceTest.php:55 [2] => tests/phpunit/api/v3/SyntaxConformanceTest.php:581 [3] => tests/phpunit/api/v3/SyntaxConformanceTest.php:964 [4] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1214 [5] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1216 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 50 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 55 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 581 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 964 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1214 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1216 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.ContentAfterOpen!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.WrongStyle' echo 'Messages:Array ( [0] => You must use \"/**\" style comments for a function comment ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/SyntaxConformanceTest.php:75 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 75 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array' echo 'Messages:Array ( [0] => A comma should follow the last multiline array item. Found: '\''Setting'\'' [1] => A comma should follow the last multiline array item. Found: '\''System'\'' [2] => A comma should follow the last multiline array item. Found: '\''Location'\'' [3] => A comma should follow the last multiline array item. Found: '\''SystemLog'\'' [4] => A comma should follow the last multiline array item. Found: '\''amount'\'' [5] => A comma should follow the last multiline array item. Found: '\''id'\'' [6] => A comma should follow the last multiline array item. Found: '\''new option value'\'' [7] => A comma should follow the last multiline array item. Found: $entity [8] => A comma should follow the last multiline array item. Found: '\''addressee'\'' [9] => A comma should follow the last multiline array item. Found: 0 [10] => A comma should follow the last multiline array item. Found: ) [11] => A comma should follow the last multiline array item. Found: '\''subject'\'' [12] => A comma should follow the last multiline array item. Found: '\''minimum_fee'\'' [13] => A comma should follow the last multiline array item. Found: '\''CRM_Event_Form_ManageEvent_Repeat::checkRegistrationForEvents'\'' [14] => A comma should follow the last multiline array item. Found: '\'''\'' [15] => A comma should follow the last multiline array item. Found: '\''entity_table'\'' [16] => A comma should follow the last multiline array item. Found: $entityTable [17] => A comma should follow the last multiline array item. Found: ] [18] => A comma should follow the last multiline array item. Found: $mainEntityTable [19] => A comma should follow the last multiline array item. Found: '\''%first second%'\'' [20] => A comma should follow the last multiline array item. Found: '\''%first%second%'\'' [21] => A comma should follow the last multiline array item. Found: '\''first second'\'' [22] => A comma should follow the last multiline array item. Found: '\''\"first second\"'\'' [23] => A comma should follow the last multiline array item. Found: '\''\"*first second*\"'\'' [24] => A comma should follow the last multiline array item. Found: '\''*first* *second*'\'' [25] => A comma should follow the last multiline array item. Found: '\''first* second*'\'' [26] => A comma should follow the last multiline array item. Found: '\''+first +second'\'' [27] => A comma should follow the last multiline array item. Found: '\''+\"first second\"'\'' [28] => A comma should follow the last multiline array item. Found: '\''+\"*first second*\"'\'' [29] => A comma should follow the last multiline array item. Found: '\''+*first* +*second*'\'' [30] => A comma should follow the last multiline array item. Found: '\''+first* +second*'\'' [31] => A comma should follow the last multiline array item. Found: MODE_WILDWORDS_SUFFIX [32] => A comma should follow the last multiline array item. Found: '\''symbol'\'' ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/SyntaxConformanceTest.php:86 [1] => tests/phpunit/api/v3/SyntaxConformanceTest.php:97 [2] => tests/phpunit/api/v3/SyntaxConformanceTest.php:107 [3] => tests/phpunit/api/v3/SyntaxConformanceTest.php:238 [4] => tests/phpunit/api/v3/SyntaxConformanceTest.php:301 [5] => tests/phpunit/api/v3/SyntaxConformanceTest.php:349 [6] => tests/phpunit/api/v3/SyntaxConformanceTest.php:423 [7] => tests/phpunit/api/v3/SyntaxConformanceTest.php:534 [8] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1161 [9] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1165 [10] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1198 [11] => CRM/Utils/Token.php:1265 [12] => CRM/Utils/Token.php:1303 [13] => CRM/Utils/Token.php:1397 [14] => CRM/Utils/Token.php:1488 [15] => CRM/Utils/Token.php:1716 [16] => CRM/Core/BAO/RecurringEntity.php:66 [17] => CRM/Core/BAO/RecurringEntity.php:71 [18] => CRM/Core/BAO/RecurringEntity.php:72 [19] => CRM/Core/BAO/RecurringEntity.php:80 [20] => CRM/Core/BAO/RecurringEntity.php:84 [21] => CRM/Core/BAO/RecurringEntity.php:110 [22] => CRM/Core/BAO/RecurringEntity.php:124 [23] => CRM/Core/BAO/RecurringEntity.php:185 [24] => CRM/Core/BAO/RecurringEntity.php:717 [25] => CRM/Core/BAO/RecurringEntity.php:918 [26] => CRM/Core/BAO/RecurringEntity.php:1095 [27] => CRM/Core/BAO/RecurringEntity.php:1125 [28] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:17 [29] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:23 [30] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:29 [31] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:35 [32] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:41 [33] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:48 [34] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:54 [35] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:60 [36] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:66 [37] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:72 [38] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:79 [39] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:85 [40] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:91 [41] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:97 [42] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:103 [43] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:110 [44] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:116 [45] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:122 [46] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:128 [47] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:134 [48] => tests/phpunit/CRM/Utils/QueryFormatterTest.php:142 [49] => CRM/Core/Form/Renderer.php:292 [50] => CRM/Utils/Money.php:93 ) ' echo '' echo 'Total number of edits to perform: 51' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 86 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 97 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 107 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 238 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 301 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 349 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 423 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 534 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1161 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1165 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1198 edit_at_line 'CRM/Utils/Token.php' 1265 edit_at_line 'CRM/Utils/Token.php' 1303 edit_at_line 'CRM/Utils/Token.php' 1397 edit_at_line 'CRM/Utils/Token.php' 1488 edit_at_line 'CRM/Utils/Token.php' 1716 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 66 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 71 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 72 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 80 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 84 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 110 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 124 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 185 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 717 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 918 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 1095 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 1125 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 17 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 23 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 29 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 35 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 41 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 48 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 54 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 60 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 66 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 72 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 79 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 85 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 91 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 97 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 103 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 110 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 116 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 122 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 128 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 134 edit_at_line 'tests/phpunit/CRM/Utils/QueryFormatterTest.php' 142 edit_at_line 'CRM/Core/Form/Renderer.php' 292 edit_at_line 'CRM/Utils/Money.php' 93 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.DocComment.WrongEnd' echo 'Messages:Array ( [0] => Wrong function doc comment end; expected \"*/\", found \"**/\" ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/SyntaxConformanceTest.php:581 [1] => tests/phpunit/api/v3/SyntaxConformanceTest.php:964 [2] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1214 [3] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1216 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 581 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 964 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1214 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1216 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => is_integer() is a function name alias, use is_int() instead ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/SyntaxConformanceTest.php:912 [1] => tests/phpunit/api/v3/SyntaxConformanceTest.php:915 [2] => tests/phpunit/api/v3/SyntaxConformanceTest.php:1387 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 912 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 915 edit_at_line 'tests/phpunit/api/v3/SyntaxConformanceTest.php' 1387 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"getListingFields\" [1] => Visibility must be declared on method \"getFields\" [2] => Visibility must be declared on method \"getEditHTML\" [3] => Visibility must be declared on method \"buildProfile\" [4] => Visibility must be declared on method \"setProfileDefaults\" [5] => Visibility must be declared on method \"getTokenDetails\" [6] => Visibility must be declared on method \"getContributionTokenDetails\" [7] => Visibility must be declared on method \"__construct\" [8] => Visibility must be declared on method \"preProcess\" ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:202 [1] => CRM/Core/BAO/UFGroup.php:281 [2] => CRM/Core/BAO/UFGroup.php:768 [3] => CRM/Core/BAO/UFGroup.php:1794 [4] => CRM/Core/BAO/UFGroup.php:2335 [5] => CRM/Utils/Token.php:1167 [6] => CRM/Utils/Token.php:1338 [7] => CRM/Core/Form/Renderer.php:70 [8] => CRM/Grant/Form/Search.php:78 ) ' echo '' echo 'Total number of edits to perform: 9' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 202 edit_at_line 'CRM/Core/BAO/UFGroup.php' 281 edit_at_line 'CRM/Core/BAO/UFGroup.php' 768 edit_at_line 'CRM/Core/BAO/UFGroup.php' 1794 edit_at_line 'CRM/Core/BAO/UFGroup.php' 2335 edit_at_line 'CRM/Utils/Token.php' 1167 edit_at_line 'CRM/Utils/Token.php' 1338 edit_at_line 'CRM/Core/Form/Renderer.php' 70 edit_at_line 'CRM/Grant/Form/Search.php' 78 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $customFields does not match actual variable name $permissionType [1] => Doc comment for parameter $skipOnHoldDon does not match actual variable name $jobID [2] => Doc comment for parameter $skipDeceasedDon does not match actual variable name $jobID ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:427 [1] => CRM/Utils/Token.php:1153 [2] => CRM/Utils/Token.php:1155 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 427 edit_at_line 'CRM/Utils/Token.php' 1153 edit_at_line 'CRM/Utils/Token.php' 1155 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for function return type [1] => Expected \"bool\" but found \"Boolean\" for function return type [2] => Expected \"array\" but found \"Array\" for function return type [3] => Expected \"bool|CRM_Core_DAO_RecurringEntity\" but found \"boolean|CRM_Core_DAO_RecurringEntity\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:714 [1] => CRM/Core/BAO/UFGroup.php:1379 [2] => CRM/Core/BAO/UFGroup.php:1404 [3] => CRM/Core/BAO/UFGroup.php:1742 [4] => CRM/Core/BAO/UFGroup.php:3109 [5] => CRM/Core/BAO/UFGroup.php:3503 [6] => CRM/Core/BAO/UFGroup.php:3553 [7] => CRM/Core/BAO/UFGroup.php:3580 [8] => CRM/Utils/Token.php:154 [9] => CRM/Core/BAO/RecurringEntity.php:788 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 714 edit_at_line 'CRM/Core/BAO/UFGroup.php' 1379 edit_at_line 'CRM/Core/BAO/UFGroup.php' 1404 edit_at_line 'CRM/Core/BAO/UFGroup.php' 1742 edit_at_line 'CRM/Core/BAO/UFGroup.php' 3109 edit_at_line 'CRM/Core/BAO/UFGroup.php' 3503 edit_at_line 'CRM/Core/BAO/UFGroup.php' 3553 edit_at_line 'CRM/Core/BAO/UFGroup.php' 3580 edit_at_line 'CRM/Utils/Token.php' 154 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 788 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturnNotVoid' echo 'Messages:Array ( [0] => Function return type is not void, but function is returning void here ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:1817 [1] => CRM/Core/BAO/UFGroup.php:2620 [2] => CRM/Core/BAO/RecurringEntity.php:1120 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 1817 edit_at_line 'CRM/Core/BAO/UFGroup.php' 2620 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 1120 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 8 spaces but found 10 [1] => Array indentation error, expected 12 spaces but found 14 [2] => Array indentation error, expected 6 spaces but found 8 ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:1845 [1] => CRM/Core/BAO/UFGroup.php:1850 [2] => CRM/Core/BAO/UFGroup.php:1851 [3] => CRM/Core/BAO/UFGroup.php:2144 [4] => CRM/Report/Form/Member/ContributionDetail.php:61 [5] => CRM/Report/Form/Member/ContributionDetail.php:111 [6] => CRM/Report/Form/Member/ContributionDetail.php:112 [7] => CRM/Report/Form/Member/ContributionDetail.php:122 [8] => CRM/Report/Form/Member/ContributionDetail.php:123 [9] => CRM/Report/Form/Member/ContributionDetail.php:133 [10] => CRM/Report/Form/Member/ContributionDetail.php:134 [11] => CRM/Report/Form/Member/ContributionDetail.php:148 [12] => CRM/Report/Form/Member/ContributionDetail.php:149 [13] => CRM/Report/Form/Member/ContributionDetail.php:222 [14] => CRM/Report/Form/Member/ContributionDetail.php:223 [15] => CRM/Report/Form/Member/ContributionDetail.php:231 [16] => CRM/Report/Form/Member/ContributionDetail.php:232 [17] => CRM/Report/Form/Member/ContributionDetail.php:245 [18] => CRM/Report/Form/Member/ContributionDetail.php:246 [19] => CRM/Report/Form/Member/ContributionDetail.php:259 [20] => CRM/Report/Form/Member/ContributionDetail.php:260 [21] => CRM/Report/Form/Member/ContributionDetail.php:299 [22] => CRM/Report/Form/Member/ContributionDetail.php:300 [23] => CRM/Report/Form/Member/ContributionDetail.php:320 [24] => CRM/Report/Form/Member/ContributionDetail.php:321 [25] => CRM/Report/Form/Member/ContributionDetail.php:337 ) ' echo '' echo 'Total number of edits to perform: 26' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 1845 edit_at_line 'CRM/Core/BAO/UFGroup.php' 1850 edit_at_line 'CRM/Core/BAO/UFGroup.php' 1851 edit_at_line 'CRM/Core/BAO/UFGroup.php' 2144 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 61 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 111 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 112 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 122 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 123 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 133 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 134 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 148 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 149 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 222 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 223 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 231 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 232 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 245 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 246 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 259 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 260 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 299 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 300 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 320 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 321 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 337 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayClosingIndentation' echo 'Messages:Array ( [0] => Array closing indentation error, expected 6 spaces but found 8 [1] => Array closing indentation error, expected 4 spaces but found 6 ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:2145 [1] => CRM/Report/Form/Member/ContributionDetail.php:338 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 2145 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 338 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidNoReturn' echo 'Messages:Array ( [0] => @return doc comment specified, but function has no return statement ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:2333 [1] => CRM/Core/Form/Renderer.php:150 [2] => CRM/Utils/API/HTMLInputCoder.php:139 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 2333 edit_at_line 'CRM/Core/Form/Renderer.php' 150 edit_at_line 'CRM/Utils/API/HTMLInputCoder.php' 139 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.SpacingAfter' echo 'Messages:Array ( [0] => There must be no blank lines after the function comment ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:2775 [1] => CRM/Core/BAO/WordReplacement.php:62 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 2775 edit_at_line 'CRM/Core/BAO/WordReplacement.php' 62 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Formatting.MultiLineAssignment' echo 'Messages:Array ( [0] => Multi-line assignments must have the equal sign on the second line ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFGroup.php:3297 [1] => CRM/Report/Form/Member/ContributionDetail.php:617 [2] => CRM/Utils/Token.php:335 [3] => CRM/Utils/Token.php:656 [4] => CRM/Utils/Token.php:702 [5] => CRM/Core/BAO/RecurringEntity.php:61 [6] => CRM/Core/BAO/RecurringEntity.php:75 [7] => CRM/Core/BAO/RecurringEntity.php:87 [8] => CRM/Core/BAO/RecurringEntity.php:98 [9] => CRM/Core/BAO/RecurringEntity.php:106 [10] => CRM/Core/BAO/RecurringEntity.php:181 [11] => CRM/Core/BAO/RecurringEntity.php:511 ) ' echo '' echo 'Total number of edits to perform: 12' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFGroup.php' 3297 edit_at_line 'CRM/Report/Form/Member/ContributionDetail.php' 617 edit_at_line 'CRM/Utils/Token.php' 335 edit_at_line 'CRM/Utils/Token.php' 656 edit_at_line 'CRM/Utils/Token.php' 702 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 61 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 75 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 87 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 98 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 106 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 181 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 511 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace' echo 'Messages:Array ( [0] => There should be no white space after an opening \"{\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/Token.php:765 [1] => CRM/Core/BAO/RecurringEntity.php:436 [2] => CRM/Core/BAO/RecurringEntity.php:439 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Token.php' 765 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 436 edit_at_line 'CRM/Core/BAO/RecurringEntity.php' 439 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Utils/Token.php:882 [1] => CRM/Utils/Token.php:928 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Token.php' 882 edit_at_line 'CRM/Utils/Token.php' 928 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines' echo 'Messages:Array ( [0] => Functions must not contain multiple empty lines in a row; found 2 empty lines ) ' echo 'Lines:Array ( [0] => CRM/Contribute/Controller/ContributionPage.php:55 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Controller/ContributionPage.php' 55 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi