#!/bin/bash ## usage: bash batch-12.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.Commenting.FunctionComment.WrongStyle' echo 'Messages:Array ( [0] => You must use \"/**\" style comments for a function comment ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/OptionGroupTest.php:52 [1] => tests/phpunit/api/v3/OptionGroupTest.php:111 [2] => tests/phpunit/api/v3/OptionGroupTest.php:128 [3] => CRM/Report/Form/Event/ParticipantListing.php:430 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/OptionGroupTest.php' 52 edit_at_line 'tests/phpunit/api/v3/OptionGroupTest.php' 111 edit_at_line 'tests/phpunit/api/v3/OptionGroupTest.php' 128 edit_at_line 'CRM/Report/Form/Event/ParticipantListing.php' 430 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: 1 [1] => A comma should follow the last multiline array item. Found: ) [2] => A comma should follow the last multiline array item. Found: PRINT_JSON [3] => A comma should follow the last multiline array item. Found: '\'' '\'' [4] => A comma should follow the last multiline array item. Found: '\''invalid json format: ?{\"param_with_double_quote\":\"value\"}'\'' [5] => A comma should follow the last multiline array item. Found: name [6] => A comma should follow the last multiline array item. Found: '\''csv'\'' [7] => A comma should follow the last multiline array item. Found: '\''%count contacts added to group'\'' [8] => A comma should follow the last multiline array item. Found: '\''%count contacts were already in group'\'' [9] => A comma should follow the last multiline array item. Found: '\''Added Contacts to %1'\'' [10] => A comma should follow the last multiline array item. Found: '\''edit-2-delete-in-civicase'\'' [11] => A comma should follow the last multiline array item. Found: $customGrpId1 [12] => A comma should follow the last multiline array item. Found: $cValue [13] => A comma should follow the last multiline array item. Found: '\''verifyPreDBstate'\'' [14] => A comma should follow the last multiline array item. Found: $phpFunctionName [15] => A comma should follow the last multiline array item. Found: '\''setPostUpgradeMessage'\'' [16] => A comma should follow the last multiline array item. Found: '\''setPreUpgradeMessage'\'' [17] => A comma should follow the last multiline array item. Found: '\''name'\'' [18] => A comma should follow the last multiline array item. Found: 4 ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/OptionGroupTest.php:97 [1] => tests/phpunit/api/v3/OptionGroupTest.php:98 [2] => CRM/Event/Badge.php:54 [3] => CRM/Event/Badge.php:157 [4] => CRM/Event/Badge.php:158 [5] => CRM/Core/Resources.php:536 [6] => CRM/Core/Resources.php:718 [7] => CRM/Core/Resources.php:741 [8] => tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php:40 [9] => tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php:75 [10] => tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php:110 [11] => tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php:144 [12] => tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php:179 [13] => tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php:215 [14] => CRM/Price/Form/Option.php:169 [15] => CRM/Utils/REST.php:563 [16] => Civi/CiUtil/PHPUnitScanner.php:91 [17] => CRM/Contribute/BAO/Contribution/Utils.php:514 [18] => CRM/Contribute/BAO/Contribution/Utils.php:571 [19] => CRM/Event/Form/Task/AddToGroup.php:239 [20] => CRM/Event/Form/Task/AddToGroup.php:240 [21] => CRM/Event/Form/Task/AddToGroup.php:245 [22] => CRM/Event/Form/Task/AddToGroup.php:252 [23] => tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php:71 [24] => tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php:212 [25] => tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php:244 [26] => tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php:271 [27] => tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php:317 [28] => CRM/Upgrade/Form.php:661 [29] => CRM/Upgrade/Form.php:681 [30] => CRM/Upgrade/Form.php:692 [31] => CRM/Upgrade/Form.php:781 [32] => CRM/Mailing/BAO/Query.php:311 [33] => CRM/Custom/Import/Parser/Api.php:33 [34] => CRM/Core/Form/RecurringEntity.php:214 [35] => CRM/Core/Form/RecurringEntity.php:414 [36] => CRM/SMS/Provider.php:212 [37] => CRM/SMS/Provider.php:219 [38] => CRM/UF/Form/AdvanceSetting.php:62 ) ' echo '' echo 'Total number of edits to perform: 39' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/OptionGroupTest.php' 97 edit_at_line 'tests/phpunit/api/v3/OptionGroupTest.php' 98 edit_at_line 'CRM/Event/Badge.php' 54 edit_at_line 'CRM/Event/Badge.php' 157 edit_at_line 'CRM/Event/Badge.php' 158 edit_at_line 'CRM/Core/Resources.php' 536 edit_at_line 'CRM/Core/Resources.php' 718 edit_at_line 'CRM/Core/Resources.php' 741 edit_at_line 'tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php' 40 edit_at_line 'tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php' 75 edit_at_line 'tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php' 110 edit_at_line 'tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php' 144 edit_at_line 'tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php' 179 edit_at_line 'tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php' 215 edit_at_line 'CRM/Price/Form/Option.php' 169 edit_at_line 'CRM/Utils/REST.php' 563 edit_at_line 'Civi/CiUtil/PHPUnitScanner.php' 91 edit_at_line 'CRM/Contribute/BAO/Contribution/Utils.php' 514 edit_at_line 'CRM/Contribute/BAO/Contribution/Utils.php' 571 edit_at_line 'CRM/Event/Form/Task/AddToGroup.php' 239 edit_at_line 'CRM/Event/Form/Task/AddToGroup.php' 240 edit_at_line 'CRM/Event/Form/Task/AddToGroup.php' 245 edit_at_line 'CRM/Event/Form/Task/AddToGroup.php' 252 edit_at_line 'tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php' 71 edit_at_line 'tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php' 212 edit_at_line 'tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php' 244 edit_at_line 'tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php' 271 edit_at_line 'tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php' 317 edit_at_line 'CRM/Upgrade/Form.php' 661 edit_at_line 'CRM/Upgrade/Form.php' 681 edit_at_line 'CRM/Upgrade/Form.php' 692 edit_at_line 'CRM/Upgrade/Form.php' 781 edit_at_line 'CRM/Mailing/BAO/Query.php' 311 edit_at_line 'CRM/Custom/Import/Parser/Api.php' 33 edit_at_line 'CRM/Core/Form/RecurringEntity.php' 214 edit_at_line 'CRM/Core/Form/RecurringEntity.php' 414 edit_at_line 'CRM/SMS/Provider.php' 212 edit_at_line 'CRM/SMS/Provider.php' 219 edit_at_line 'CRM/UF/Form/AdvanceSetting.php' 62 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/OptionGroupTest.php:102 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/OptionGroupTest.php' 102 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.$InReturnType' echo 'Messages:Array ( [0] => @return data type must not contain \"$\" ) ' echo 'Lines:Array ( [0] => CRM/Event/BAO/ParticipantStatusType.php:39 [1] => CRM/Event/BAO/ParticipantStatusType.php:53 [2] => CRM/SMS/Provider.php:123 [3] => CRM/SMS/Provider.php:189 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/BAO/ParticipantStatusType.php' 39 edit_at_line 'CRM/Event/BAO/ParticipantStatusType.php' 53 edit_at_line 'CRM/SMS/Provider.php' 123 edit_at_line 'CRM/SMS/Provider.php' 189 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.$InReturnType!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Classes.ClassCreateInstance' echo 'Messages:Array ( [0] => Calling class constructors must always include parentheses ) ' echo 'Lines:Array ( [0] => CRM/Event/BAO/ParticipantStatusType.php:45 [1] => CRM/Event/BAO/ParticipantStatusType.php:73 [2] => CRM/Event/BAO/ParticipantStatusType.php:81 [3] => CRM/Event/BAO/ParticipantStatusType.php:97 [4] => CRM/Contribute/BAO/Contribution/Utils.php:809 [5] => CRM/Contribute/BAO/Contribution/Utils.php:812 [6] => CRM/Logging/Schema.php:146 [7] => CRM/Logging/Schema.php:350 [8] => CRM/Logging/Schema.php:533 ) ' echo '' echo 'Total number of edits to perform: 9' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/BAO/ParticipantStatusType.php' 45 edit_at_line 'CRM/Event/BAO/ParticipantStatusType.php' 73 edit_at_line 'CRM/Event/BAO/ParticipantStatusType.php' 81 edit_at_line 'CRM/Event/BAO/ParticipantStatusType.php' 97 edit_at_line 'CRM/Contribute/BAO/Contribution/Utils.php' 809 edit_at_line 'CRM/Contribute/BAO/Contribution/Utils.php' 812 edit_at_line 'CRM/Logging/Schema.php' 146 edit_at_line 'CRM/Logging/Schema.php' 350 edit_at_line 'CRM/Logging/Schema.php' 533 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 10 spaces but found 12 [1] => Array indentation error, expected 6 spaces but found 8 [2] => Array indentation error, expected 8 spaces but found 10 [3] => Array indentation error, expected 4 spaces but found 6 [4] => Array indentation error, expected 4 spaces but found 8 ) ' echo 'Lines:Array ( [0] => CRM/Contact/Page/View/Summary.php:363 [1] => CRM/Contact/Page/View/Summary.php:364 [2] => CRM/Contact/Page/View/Summary.php:367 [3] => CRM/Contact/Page/View/Summary.php:368 [4] => CRM/Contact/Page/View/Summary.php:369 [5] => tests/phpunit/WebTest/Import/MultipleRelationshipTest.php:71 [6] => tests/phpunit/WebTest/Import/MultipleRelationshipTest.php:97 [7] => tests/phpunit/WebTest/Import/MultipleRelationshipTest.php:113 [8] => tests/phpunit/WebTest/Import/MultipleRelationshipTest.php:139 [9] => tests/phpunit/WebTest/Import/MultipleRelationshipTest.php:153 [10] => tests/phpunit/WebTest/Import/MultipleRelationshipTest.php:179 [11] => api/v3/Constant.php:188 [12] => api/v3/Constant.php:189 [13] => api/v3/Constant.php:190 [14] => api/v3/Constant.php:191 [15] => CRM/Report/Form/Contribute/TopDonor.php:53 [16] => CRM/Report/Form/Contribute/TopDonor.php:78 ) ' echo '' echo 'Total number of edits to perform: 17' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Page/View/Summary.php' 363 edit_at_line 'CRM/Contact/Page/View/Summary.php' 364 edit_at_line 'CRM/Contact/Page/View/Summary.php' 367 edit_at_line 'CRM/Contact/Page/View/Summary.php' 368 edit_at_line 'CRM/Contact/Page/View/Summary.php' 369 edit_at_line 'tests/phpunit/WebTest/Import/MultipleRelationshipTest.php' 71 edit_at_line 'tests/phpunit/WebTest/Import/MultipleRelationshipTest.php' 97 edit_at_line 'tests/phpunit/WebTest/Import/MultipleRelationshipTest.php' 113 edit_at_line 'tests/phpunit/WebTest/Import/MultipleRelationshipTest.php' 139 edit_at_line 'tests/phpunit/WebTest/Import/MultipleRelationshipTest.php' 153 edit_at_line 'tests/phpunit/WebTest/Import/MultipleRelationshipTest.php' 179 edit_at_line 'api/v3/Constant.php' 188 edit_at_line 'api/v3/Constant.php' 189 edit_at_line 'api/v3/Constant.php' 190 edit_at_line 'api/v3/Constant.php' 191 edit_at_line 'CRM/Report/Form/Contribute/TopDonor.php' 53 edit_at_line 'CRM/Report/Form/Contribute/TopDonor.php' 78 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 8 spaces but found 10 [1] => Array closing indentation error, expected 2 spaces but found 6 [2] => Array closing indentation error, expected 4 spaces but found 6 ) ' echo 'Lines:Array ( [0] => CRM/Contact/Page/View/Summary.php:370 [1] => api/v3/Constant.php:192 [2] => CRM/Report/Form/Contribute/TopDonor.php:79 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Page/View/Summary.php' 370 edit_at_line 'api/v3/Constant.php' 192 edit_at_line 'CRM/Report/Form/Contribute/TopDonor.php' 79 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ReturnCommentIndentation' echo 'Messages:Array ( [0] => Return comment indentation must be 3 spaces, found 1 spaces ) ' echo 'Lines:Array ( [0] => api/v3/ContributionSoft.php:51 [1] => api/v3/ContributionSoft.php:79 [2] => api/v3/ContributionSoft.php:100 [3] => Civi/CiUtil/PHPUnitScanner.php:33 [4] => api/v3/LineItem.php:47 [5] => api/v3/LineItem.php:78 [6] => api/v3/LineItem.php:96 [7] => api/v3/ContributionRecur.php:46 [8] => api/v3/ContributionRecur.php:76 [9] => api/v3/ContributionRecur.php:110 [10] => api/v3/GroupOrganization.php:102 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/ContributionSoft.php' 51 edit_at_line 'api/v3/ContributionSoft.php' 79 edit_at_line 'api/v3/ContributionSoft.php' 100 edit_at_line 'Civi/CiUtil/PHPUnitScanner.php' 33 edit_at_line 'api/v3/LineItem.php' 47 edit_at_line 'api/v3/LineItem.php' 78 edit_at_line 'api/v3/LineItem.php' 96 edit_at_line 'api/v3/ContributionRecur.php' 46 edit_at_line 'api/v3/ContributionRecur.php' 76 edit_at_line 'api/v3/ContributionRecur.php' 110 edit_at_line 'api/v3/GroupOrganization.php' 102 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' 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 ) ' echo 'Lines:Array ( [0] => api/v3/ContributionSoft.php:77 [1] => api/v3/ContributionRecur.php:88 [2] => api/v3/Case.php:371 [3] => CRM/Custom/Import/Parser/Api.php:62 [4] => CRM/Custom/Import/Parser/Api.php:74 [5] => CRM/Custom/Import/Parser/Api.php:85 [6] => CRM/Custom/Import/Parser/Api.php:139 [7] => CRM/Core/InnoDBIndexer.php:276 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/ContributionSoft.php' 77 edit_at_line 'api/v3/ContributionRecur.php' 88 edit_at_line 'api/v3/Case.php' 371 edit_at_line 'CRM/Custom/Import/Parser/Api.php' 62 edit_at_line 'CRM/Custom/Import/Parser/Api.php' 74 edit_at_line 'CRM/Custom/Import/Parser/Api.php' 85 edit_at_line 'CRM/Custom/Import/Parser/Api.php' 139 edit_at_line 'CRM/Core/InnoDBIndexer.php' 276 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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] => api/v3/ContributionSoft.php:77 [1] => CRM/Event/Badge.php:83 [2] => CRM/Event/Badge.php:192 [3] => CRM/Core/Resources.php:618 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/ContributionSoft.php' 77 edit_at_line 'CRM/Event/Badge.php' 83 edit_at_line 'CRM/Event/Badge.php' 192 edit_at_line 'CRM/Core/Resources.php' 618 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => api/v3/ContributionSoft.php:90 [1] => CRM/Price/Form/Option.php:58 [2] => CRM/Price/Form/Option.php:76 [3] => CRM/Price/Form/Option.php:118 [4] => CRM/Price/Form/Option.php:297 [5] => CRM/Utils/Wrapper.php:55 [6] => CRM/Utils/Wrapper.php:56 [7] => CRM/Utils/Wrapper.php:57 [8] => CRM/Utils/Wrapper.php:58 [9] => CRM/Utils/Wrapper.php:59 [10] => api/v3/Case.php:42 [11] => api/v3/Case.php:185 [12] => api/v3/Case.php:295 [13] => api/v3/Case.php:363 [14] => CRM/Core/Selector/API.php:54 [15] => CRM/Core/Selector/API.php:55 [16] => CRM/Core/Selector/API.php:64 [17] => CRM/Core/Selector/API.php:88 [18] => CRM/Core/Selector/API.php:127 [19] => CRM/Dedupe/BAO/Rule.php:191 ) ' echo '' echo 'Total number of edits to perform: 20' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/ContributionSoft.php' 90 edit_at_line 'CRM/Price/Form/Option.php' 58 edit_at_line 'CRM/Price/Form/Option.php' 76 edit_at_line 'CRM/Price/Form/Option.php' 118 edit_at_line 'CRM/Price/Form/Option.php' 297 edit_at_line 'CRM/Utils/Wrapper.php' 55 edit_at_line 'CRM/Utils/Wrapper.php' 56 edit_at_line 'CRM/Utils/Wrapper.php' 57 edit_at_line 'CRM/Utils/Wrapper.php' 58 edit_at_line 'CRM/Utils/Wrapper.php' 59 edit_at_line 'api/v3/Case.php' 42 edit_at_line 'api/v3/Case.php' 185 edit_at_line 'api/v3/Case.php' 295 edit_at_line 'api/v3/Case.php' 363 edit_at_line 'CRM/Core/Selector/API.php' 54 edit_at_line 'CRM/Core/Selector/API.php' 55 edit_at_line 'CRM/Core/Selector/API.php' 64 edit_at_line 'CRM/Core/Selector/API.php' 88 edit_at_line 'CRM/Core/Selector/API.php' 127 edit_at_line 'CRM/Dedupe/BAO/Rule.php' 191 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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] => CRM/Event/Badge.php:175 [1] => CRM/Utils/REST.php:528 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Badge.php' 175 edit_at_line 'CRM/Utils/REST.php' 528 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.Incorrect' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 6 spaces, found 8 ) ' echo 'Lines:Array ( [0] => CRM/Core/Resources.php:260 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Resources.php' 260 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 8 spaces, found 10 [1] => Line indented incorrectly; expected 4 spaces, found 0 ) ' echo 'Lines:Array ( [0] => CRM/Core/Resources.php:261 [1] => Civi/CiUtil/Command/AntagonistCommand.php:13 [2] => Civi/CiUtil/Command/AntagonistCommand.php:14 [3] => Civi/CiUtil/Command/AntagonistCommand.php:15 [4] => Civi/CiUtil/Command/AntagonistCommand.php:16 [5] => Civi/CiUtil/Command/AntagonistCommand.php:17 [6] => Civi/CiUtil/Command/AntagonistCommand.php:18 [7] => Civi/CiUtil/PHPUnitScanner.php:15 [8] => Civi/CiUtil/PHPUnitScanner.php:16 [9] => Civi/CiUtil/PHPUnitScanner.php:17 [10] => Civi/CiUtil/PHPUnitScanner.php:18 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Resources.php' 261 edit_at_line 'Civi/CiUtil/Command/AntagonistCommand.php' 13 edit_at_line 'Civi/CiUtil/Command/AntagonistCommand.php' 14 edit_at_line 'Civi/CiUtil/Command/AntagonistCommand.php' 15 edit_at_line 'Civi/CiUtil/Command/AntagonistCommand.php' 16 edit_at_line 'Civi/CiUtil/Command/AntagonistCommand.php' 17 edit_at_line 'Civi/CiUtil/Command/AntagonistCommand.php' 18 edit_at_line 'Civi/CiUtil/PHPUnitScanner.php' 15 edit_at_line 'Civi/CiUtil/PHPUnitScanner.php' 16 edit_at_line 'Civi/CiUtil/PHPUnitScanner.php' 17 edit_at_line 'Civi/CiUtil/PHPUnitScanner.php' 18 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!' 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/Price/Form/Option.php:83 [1] => CRM/Core/BAO/PrevNextCache.php:415 [2] => CRM/Dedupe/BAO/Rule.php:220 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Price/Form/Option.php' 83 edit_at_line 'CRM/Core/BAO/PrevNextCache.php' 415 edit_at_line 'CRM/Dedupe/BAO/Rule.php' 220 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' 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] => CRM/Utils/REST.php:471 [1] => CRM/Utils/REST.php:525 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/REST.php' 471 edit_at_line 'CRM/Utils/REST.php' 525 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.ContentAfterOpen!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"loadTemplate\" [1] => Visibility must be declared on method \"processConfirm\" [2] => Visibility must be declared on method \"__construct\" [3] => Visibility must be declared on method \"defaultReturnProperties\" [4] => Visibility must be declared on method \"send\" [5] => Visibility must be declared on method \"view\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/REST.php:472 [1] => CRM/Contribute/BAO/Contribution/Utils.php:64 [2] => CRM/Upgrade/Form.php:101 [3] => CRM/Mailing/BAO/Query.php:200 [4] => CRM/SMS/Provider.php:92 [5] => CRM/Contribute/Page/ContributionRecur.php:51 [6] => Civi/Core/Event/UnhandledExceptionEvent.php:46 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/REST.php' 472 edit_at_line 'CRM/Contribute/BAO/Contribution/Utils.php' 64 edit_at_line 'CRM/Upgrade/Form.php' 101 edit_at_line 'CRM/Mailing/BAO/Query.php' 200 edit_at_line 'CRM/SMS/Provider.php' 92 edit_at_line 'CRM/Contribute/Page/ContributionRecur.php' 51 edit_at_line 'Civi/Core/Event/UnhandledExceptionEvent.php' 46 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Arrays.ArrayDeclaration.NoKeySpecified' echo 'Messages:Array ( [0] => No key specified for array entry; first entry specifies key ) ' echo 'Lines:Array ( [0] => CRM/Utils/REST.php:562 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/REST.php' 562 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Arrays.ArrayDeclaration.NoKeySpecified!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $fields does not match actual variable name $params [1] => Doc comment for parameter $fields does not match actual variable name $values ) ' echo 'Lines:Array ( [0] => CRM/Event/Form/Task/AddToGroup.php:181 [1] => CRM/Core/Form/RecurringEntity.php:238 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Form/Task/AddToGroup.php' 181 edit_at_line 'CRM/Core/Form/RecurringEntity.php' 238 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' 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/Report/Form/Contact/Detail.php:410 [1] => CRM/Report/Form/Contact/Detail.php:787 [2] => CRM/Report/Form/Contact/Detail.php:790 [3] => CRM/Report/Form/Contact/Detail.php:794 [4] => CRM/Report/Form/Contact/Detail.php:865 [5] => CRM/Report/Form/Event/ParticipantListing.php:384 [6] => CRM/Report/Form/Event/ParticipantListing.php:389 [7] => CRM/Report/Form/Event/ParticipantListing.php:395 [8] => CRM/Report/Form/Event/ParticipantListing.php:576 [9] => CRM/Mailing/BAO/Query.php:67 [10] => CRM/Mailing/BAO/Query.php:86 [11] => CRM/Mailing/BAO/Query.php:114 [12] => CRM/Core/Form/RecurringEntity.php:372 [13] => CRM/Core/Form/RecurringEntity.php:384 [14] => CRM/Logging/Schema.php:410 [15] => CRM/Core/BAO/PrevNextCache.php:150 ) ' echo '' echo 'Total number of edits to perform: 16' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contact/Detail.php' 410 edit_at_line 'CRM/Report/Form/Contact/Detail.php' 787 edit_at_line 'CRM/Report/Form/Contact/Detail.php' 790 edit_at_line 'CRM/Report/Form/Contact/Detail.php' 794 edit_at_line 'CRM/Report/Form/Contact/Detail.php' 865 edit_at_line 'CRM/Report/Form/Event/ParticipantListing.php' 384 edit_at_line 'CRM/Report/Form/Event/ParticipantListing.php' 389 edit_at_line 'CRM/Report/Form/Event/ParticipantListing.php' 395 edit_at_line 'CRM/Report/Form/Event/ParticipantListing.php' 576 edit_at_line 'CRM/Mailing/BAO/Query.php' 67 edit_at_line 'CRM/Mailing/BAO/Query.php' 86 edit_at_line 'CRM/Mailing/BAO/Query.php' 114 edit_at_line 'CRM/Core/Form/RecurringEntity.php' 372 edit_at_line 'CRM/Core/Form/RecurringEntity.php' 384 edit_at_line 'CRM/Logging/Schema.php' 410 edit_at_line 'CRM/Core/BAO/PrevNextCache.php' 150 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.Comma.NoSpace' echo 'Messages:Array ( [0] => Expected one space after the comma, 0 found ) ' echo 'Lines:Array ( [0] => api/v3/LineItem.php:50 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/LineItem.php' 50 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.NoSpace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Generic.PHP.UpperCaseConstant.Found' echo 'Messages:Array ( [0] => TRUE, FALSE and NULL must be uppercase; expected \"TRUE\" but found \"True\" ) ' echo 'Lines:Array ( [0] => api/v3/LineItem.php:50 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/LineItem.php' 50 echo '===============================================================' echo '' echo 'Completed formatting issue Generic.PHP.UpperCaseConstant.Found!' 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] => api/v3/ContributionRecur.php:90 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/ContributionRecur.php' 90 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OperatorSpacing.SpacingBefore' echo 'Messages:Array ( [0] => Expected 1 space before \"+\"; newline found ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Contribute/TopDonor.php:80 [1] => CRM/Report/Form/Contribute/TopDonor.php:81 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contribute/TopDonor.php' 80 edit_at_line 'CRM/Report/Form/Contribute/TopDonor.php' 81 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OperatorSpacing.SpacingBefore!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.ControlStructures.InlineControlStructure.NotAllowed' echo 'Messages:Array ( [0] => Inline control structures are not allowed ) ' echo 'Lines:Array ( [0] => CRM/Logging/Schema.php:355 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Logging/Schema.php' 355 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' 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/Core/BAO/PrevNextCache.php:92 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/PrevNextCache.php' 92 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Formatting.SpaceInlineIf.SpacingAfter' echo 'Messages:Array ( [0] => Expected 1 space after \"?\"; newline found [1] => Expected 1 space after \":\"; newline found ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/PrevNextCache.php:151 [1] => CRM/Core/BAO/PrevNextCache.php:152 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/PrevNextCache.php' 151 edit_at_line 'CRM/Core/BAO/PrevNextCache.php' 152 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.SpaceInlineIf.SpacingAfter!' echo '' echo 'Yay!' echo '' fi