#!/bin/bash ## usage: bash batch-17.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.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Custom/Form/Preview.php:58 [1] => CRM/Custom/Form/Preview.php:97 [2] => CRM/Custom/Form/Preview.php:113 [3] => CRM/Custom/Page/Field.php:65 [4] => CRM/Custom/Page/Field.php:122 [5] => CRM/Custom/Page/Field.php:229 [6] => CRM/Custom/Form/DeleteField.php:58 [7] => CRM/Custom/Form/DeleteField.php:78 [8] => CRM/Custom/Form/DeleteField.php:101 [9] => CRM/Core/BAO/Navigation.php:87 [10] => CRM/Utils/Pager.php:255 [11] => CRM/Contact/Import/Form/MapField.php:65 [12] => CRM/Contact/Import/Form/MapField.php:66 [13] => CRM/Core/StateMachine.php:114 [14] => CRM/Custom/Page/Group.php:56 [15] => CRM/Custom/Page/Group.php:111 [16] => CRM/Custom/Import/Parser.php:294 [17] => CRM/Campaign/Form/Petition.php:125 ) ' echo '' echo 'Total number of edits to perform: 18' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Custom/Form/Preview.php' 58 edit_at_line 'CRM/Custom/Form/Preview.php' 97 edit_at_line 'CRM/Custom/Form/Preview.php' 113 edit_at_line 'CRM/Custom/Page/Field.php' 65 edit_at_line 'CRM/Custom/Page/Field.php' 122 edit_at_line 'CRM/Custom/Page/Field.php' 229 edit_at_line 'CRM/Custom/Form/DeleteField.php' 58 edit_at_line 'CRM/Custom/Form/DeleteField.php' 78 edit_at_line 'CRM/Custom/Form/DeleteField.php' 101 edit_at_line 'CRM/Core/BAO/Navigation.php' 87 edit_at_line 'CRM/Utils/Pager.php' 255 edit_at_line 'CRM/Contact/Import/Form/MapField.php' 65 edit_at_line 'CRM/Contact/Import/Form/MapField.php' 66 edit_at_line 'CRM/Core/StateMachine.php' 114 edit_at_line 'CRM/Custom/Page/Group.php' 56 edit_at_line 'CRM/Custom/Page/Group.php' 111 edit_at_line 'CRM/Custom/Import/Parser.php' 294 edit_at_line 'CRM/Campaign/Form/Petition.php' 125 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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: 20 [1] => A comma should follow the last multiline array item. Found: ] [2] => A comma should follow the last multiline array item. Found: _id [3] => A comma should follow the last multiline array item. Found: '\''Fixed'\'' [4] => A comma should follow the last multiline array item. Found: '\''min_contribution'\'' [5] => A comma should follow the last multiline array item. Found: '\''Household'\'' [6] => A comma should follow the last multiline array item. Found: ) [7] => A comma should follow the last multiline array item. Found: '\''label'\'' [8] => A comma should follow the last multiline array item. Found: '\''max_amount'\'' [9] => A comma should follow the last multiline array item. Found: $totalAddresses [10] => A comma should follow the last multiline array item. Found: $totalGeocoded [11] => A comma should follow the last multiline array item. Found: $totalAddressParsed [12] => A comma should follow the last multiline array item. Found: '\''Contacts'\'' [13] => A comma should follow the last multiline array item. Found: '\''address'\'' [14] => A comma should follow the last multiline array item. Found: '\''OpenID'\'' [15] => A comma should follow the last multiline array item. Found: '\''divName'\'' [16] => A comma should follow the last multiline array item. Found: '\''ContactReference'\'' [17] => A comma should follow the last multiline array item. Found: '\''Organization'\'' [18] => A comma should follow the last multiline array item. Found: '\''deceased_date'\'' [19] => A comma should follow the last multiline array item. Found: '\''email'\'' [20] => A comma should follow the last multiline array item. Found: '\''total_amount'\'' [21] => A comma should follow the last multiline array item. Found: '\''Autocomplete-Select'\'' [22] => A comma should follow the last multiline array item. Found: '\''Status'\'' [23] => A comma should follow the last multiline array item. Found: '\''Scheduled'\'' [24] => A comma should follow the last multiline array item. Found: '\''128'\'' [25] => A comma should follow the last multiline array item. Found: '\''%1 Related Cases'\'' [26] => A comma should follow the last multiline array item. Found: '\''event_id'\'' [27] => A comma should follow the last multiline array item. Found: '\''next'\'' [28] => A comma should follow the last multiline array item. Found: '\''circle-check'\'' [29] => A comma should follow the last multiline array item. Found: NULL [30] => A comma should follow the last multiline array item. Found: '\''handleException'\'' ) ' echo 'Lines:Array ( [0] => CRM/Contribute/Form/UpdateSubscription.php:152 [1] => CRM/Contribute/Form/UpdateSubscription.php:241 [2] => CRM/Contribute/Form/ManagePremiums.php:109 [3] => CRM/Contribute/Form/ManagePremiums.php:142 [4] => CRM/Contribute/Form/ManagePremiums.php:347 [5] => CRM/Contribute/Form/Contribution/Main.php:162 [6] => CRM/Contribute/Form/Contribution/Main.php:179 [7] => CRM/Contribute/Form/ContributionPage/Amount.php:155 [8] => CRM/Contribute/Form/ContributionPage/Amount.php:213 [9] => CRM/Contribute/Form/ContributionPage/Amount.php:469 [10] => CRM/Utils/Address/BatchUpdate.php:259 [11] => CRM/Utils/Address/BatchUpdate.php:263 [12] => CRM/Utils/Address/BatchUpdate.php:268 [13] => CRM/Core/BAO/Navigation.php:315 [14] => CRM/Core/BAO/Navigation.php:496 [15] => CRM/Core/BAO/Location.php:112 [16] => CRM/Core/BAO/Location.php:371 [17] => CRM/Utils/Pager.php:129 [18] => CRM/Utils/Pager.php:133 [19] => CRM/Utils/OpenFlashChart.php:478 [20] => CRM/Utils/OpenFlashChart.php:518 [21] => CRM/Core/BAO/CustomOption.php:156 [22] => CRM/Contact/Import/Form/MapField.php:138 [23] => CRM/Event/Form/Task/ParticipantStatus.php:48 [24] => CRM/Dedupe/Finder.php:239 [25] => CRM/Event/Form/ManageEvent/Location.php:208 [26] => CRM/Event/Form/ManageEvent/Location.php:263 [27] => CRM/Event/Form/EventFees.php:242 [28] => CRM/Event/Form/EventFees.php:404 [29] => CRM/Custom/Form/ChangeFieldType.php:115 [30] => CRM/Custom/Form/ChangeFieldType.php:171 [31] => CRM/Event/Form/ManageEvent/Fee.php:300 [32] => CRM/Event/Form/ManageEvent.php:213 [33] => CRM/Event/Form/ManageEvent.php:223 [34] => CRM/Case/Audit/Audit.php:103 [35] => CRM/Campaign/Form/Task/Reserve.php:98 [36] => CRM/Campaign/Form/Task/Reserve.php:182 [37] => CRM/Campaign/Form/Search/Survey.php:89 [38] => CRM/Campaign/Form/Petition.php:202 [39] => CRM/Case/Form/Case.php:264 [40] => CRM/Case/Form/CaseView.php:173 [41] => CRM/Case/Form/CaseView.php:315 [42] => CRM/Contact/Form/Search/Custom/EventAggregate.php:99 [43] => CRM/Contact/Form/Merge.php:134 [44] => CRM/Contact/Form/Merge.php:285 [45] => CRM/Contact/Form/Edit/Phone.php:68 [46] => CRM/Contact/Form/Edit/Phone.php:81 [47] => Civi/Core/Container.php:103 ) ' echo '' echo 'Total number of edits to perform: 48' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/UpdateSubscription.php' 152 edit_at_line 'CRM/Contribute/Form/UpdateSubscription.php' 241 edit_at_line 'CRM/Contribute/Form/ManagePremiums.php' 109 edit_at_line 'CRM/Contribute/Form/ManagePremiums.php' 142 edit_at_line 'CRM/Contribute/Form/ManagePremiums.php' 347 edit_at_line 'CRM/Contribute/Form/Contribution/Main.php' 162 edit_at_line 'CRM/Contribute/Form/Contribution/Main.php' 179 edit_at_line 'CRM/Contribute/Form/ContributionPage/Amount.php' 155 edit_at_line 'CRM/Contribute/Form/ContributionPage/Amount.php' 213 edit_at_line 'CRM/Contribute/Form/ContributionPage/Amount.php' 469 edit_at_line 'CRM/Utils/Address/BatchUpdate.php' 259 edit_at_line 'CRM/Utils/Address/BatchUpdate.php' 263 edit_at_line 'CRM/Utils/Address/BatchUpdate.php' 268 edit_at_line 'CRM/Core/BAO/Navigation.php' 315 edit_at_line 'CRM/Core/BAO/Navigation.php' 496 edit_at_line 'CRM/Core/BAO/Location.php' 112 edit_at_line 'CRM/Core/BAO/Location.php' 371 edit_at_line 'CRM/Utils/Pager.php' 129 edit_at_line 'CRM/Utils/Pager.php' 133 edit_at_line 'CRM/Utils/OpenFlashChart.php' 478 edit_at_line 'CRM/Utils/OpenFlashChart.php' 518 edit_at_line 'CRM/Core/BAO/CustomOption.php' 156 edit_at_line 'CRM/Contact/Import/Form/MapField.php' 138 edit_at_line 'CRM/Event/Form/Task/ParticipantStatus.php' 48 edit_at_line 'CRM/Dedupe/Finder.php' 239 edit_at_line 'CRM/Event/Form/ManageEvent/Location.php' 208 edit_at_line 'CRM/Event/Form/ManageEvent/Location.php' 263 edit_at_line 'CRM/Event/Form/EventFees.php' 242 edit_at_line 'CRM/Event/Form/EventFees.php' 404 edit_at_line 'CRM/Custom/Form/ChangeFieldType.php' 115 edit_at_line 'CRM/Custom/Form/ChangeFieldType.php' 171 edit_at_line 'CRM/Event/Form/ManageEvent/Fee.php' 300 edit_at_line 'CRM/Event/Form/ManageEvent.php' 213 edit_at_line 'CRM/Event/Form/ManageEvent.php' 223 edit_at_line 'CRM/Case/Audit/Audit.php' 103 edit_at_line 'CRM/Campaign/Form/Task/Reserve.php' 98 edit_at_line 'CRM/Campaign/Form/Task/Reserve.php' 182 edit_at_line 'CRM/Campaign/Form/Search/Survey.php' 89 edit_at_line 'CRM/Campaign/Form/Petition.php' 202 edit_at_line 'CRM/Case/Form/Case.php' 264 edit_at_line 'CRM/Case/Form/CaseView.php' 173 edit_at_line 'CRM/Case/Form/CaseView.php' 315 edit_at_line 'CRM/Contact/Form/Search/Custom/EventAggregate.php' 99 edit_at_line 'CRM/Contact/Form/Merge.php' 134 edit_at_line 'CRM/Contact/Form/Merge.php' 285 edit_at_line 'CRM/Contact/Form/Edit/Phone.php' 68 edit_at_line 'CRM/Contact/Form/Edit/Phone.php' 81 edit_at_line 'Civi/Core/Container.php' 103 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/Contribute/Form/UpdateSubscription.php:318 [1] => CRM/Contribute/Form/UpdateBilling.php:433 [2] => CRM/Contribute/Form/UpdateBilling.php:436 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/UpdateSubscription.php' 318 edit_at_line 'CRM/Contribute/Form/UpdateBilling.php' 433 edit_at_line 'CRM/Contribute/Form/UpdateBilling.php' 436 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => sizeof() is a function name alias, use count() instead ) ' echo 'Lines:Array ( [0] => CRM/Contribute/Form/Contribution/Main.php:690 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/Contribution/Main.php' 690 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' 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/Grant.php:49 [1] => api/v3/Grant.php:77 [2] => api/v3/Grant.php:95 [3] => CRM/Utils/VersionCheck.php:199 [4] => api/v3/CustomSearch.php:15 [5] => api/v3/CustomSearch.php:36 [6] => api/v3/CustomSearch.php:75 [7] => api/v3/UFField.php:137 [8] => api/v3/ParticipantStatusType.php:49 [9] => api/v3/ParticipantStatusType.php:66 [10] => api/v3/ParticipantStatusType.php:85 [11] => api/v3/OptionValue.php:13 [12] => api/v3/OptionValue.php:41 [13] => api/v3/OptionValue.php:82 [14] => api/v3/Survey.php:47 [15] => api/v3/Survey.php:74 [16] => api/v3/Survey.php:92 [17] => api/v3/PriceField.php:47 [18] => api/v3/PriceField.php:73 [19] => api/v3/PriceField.php:91 [20] => api/v3/PriceSet.php:47 [21] => api/v3/PriceSet.php:87 [22] => api/v3/PriceSet.php:115 [23] => api/v3/PriceFieldValue.php:47 [24] => api/v3/PriceFieldValue.php:86 [25] => api/v3/PriceFieldValue.php:104 [26] => api/v3/Tag.php:49 [27] => api/v3/Tag.php:76 [28] => api/v3/Tag.php:95 [29] => api/v3/MembershipStatus.php:49 [30] => api/v3/MembershipStatus.php:65 [31] => api/v3/MailingEventSubscribe.php:49 [32] => api/v3/MailSettings.php:46 [33] => api/v3/MailSettings.php:73 [34] => api/v3/MailSettings.php:91 [35] => api/v3/MailingEventResubscribe.php:48 ) ' echo '' echo 'Total number of edits to perform: 36' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Grant.php' 49 edit_at_line 'api/v3/Grant.php' 77 edit_at_line 'api/v3/Grant.php' 95 edit_at_line 'CRM/Utils/VersionCheck.php' 199 edit_at_line 'api/v3/CustomSearch.php' 15 edit_at_line 'api/v3/CustomSearch.php' 36 edit_at_line 'api/v3/CustomSearch.php' 75 edit_at_line 'api/v3/UFField.php' 137 edit_at_line 'api/v3/ParticipantStatusType.php' 49 edit_at_line 'api/v3/ParticipantStatusType.php' 66 edit_at_line 'api/v3/ParticipantStatusType.php' 85 edit_at_line 'api/v3/OptionValue.php' 13 edit_at_line 'api/v3/OptionValue.php' 41 edit_at_line 'api/v3/OptionValue.php' 82 edit_at_line 'api/v3/Survey.php' 47 edit_at_line 'api/v3/Survey.php' 74 edit_at_line 'api/v3/Survey.php' 92 edit_at_line 'api/v3/PriceField.php' 47 edit_at_line 'api/v3/PriceField.php' 73 edit_at_line 'api/v3/PriceField.php' 91 edit_at_line 'api/v3/PriceSet.php' 47 edit_at_line 'api/v3/PriceSet.php' 87 edit_at_line 'api/v3/PriceSet.php' 115 edit_at_line 'api/v3/PriceFieldValue.php' 47 edit_at_line 'api/v3/PriceFieldValue.php' 86 edit_at_line 'api/v3/PriceFieldValue.php' 104 edit_at_line 'api/v3/Tag.php' 49 edit_at_line 'api/v3/Tag.php' 76 edit_at_line 'api/v3/Tag.php' 95 edit_at_line 'api/v3/MembershipStatus.php' 49 edit_at_line 'api/v3/MembershipStatus.php' 65 edit_at_line 'api/v3/MailingEventSubscribe.php' 49 edit_at_line 'api/v3/MailSettings.php' 46 edit_at_line 'api/v3/MailSettings.php' 73 edit_at_line 'api/v3/MailSettings.php' 91 edit_at_line 'api/v3/MailingEventResubscribe.php' 48 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' 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 8 [1] => Array indentation error, expected 8 spaces but found 10 [2] => Array indentation error, expected 4 spaces but found 0 ) ' echo 'Lines:Array ( [0] => api/v3/Domain.php:90 [1] => api/v3/Domain.php:91 [2] => api/v3/Domain.php:94 [3] => CRM/Case/Form/Activity.php:285 [4] => settings/Developer.setting.php:70 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Domain.php' 90 edit_at_line 'api/v3/Domain.php' 91 edit_at_line 'api/v3/Domain.php' 94 edit_at_line 'CRM/Case/Form/Activity.php' 285 edit_at_line 'settings/Developer.setting.php' 70 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' 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/Utils/VersionCheck.php:312 [1] => CRM/Utils/VersionCheck.php:356 [2] => CRM/Event/Form/Task/ParticipantStatus.php:39 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/VersionCheck.php' 312 edit_at_line 'CRM/Utils/VersionCheck.php' 356 edit_at_line 'CRM/Event/Form/Task/ParticipantStatus.php' 39 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' 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/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php:83 [1] => CRM/Contribute/Form/AdditionalPayment.php:164 [2] => CRM/Event/Form/Task/Batch.php:353 [3] => CRM/Core/Smarty/plugins/function.isValueChange.php:60 [4] => CRM/Campaign/BAO/Petition.php:180 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php' 83 edit_at_line 'CRM/Contribute/Form/AdditionalPayment.php' 164 edit_at_line 'CRM/Event/Form/Task/Batch.php' 353 edit_at_line 'CRM/Core/Smarty/plugins/function.isValueChange.php' 60 edit_at_line 'CRM/Campaign/BAO/Petition.php' 180 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' 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 \"int\" but found \"number\" for function return type [2] => Expected \"array\" but found \"Array\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php:193 [1] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php:212 [2] => CRM/Core/BAO/Location.php:219 [3] => CRM/Core/BAO/Block.php:136 [4] => CRM/Core/BAO/Block.php:156 [5] => CRM/Core/BAO/Block.php:521 [6] => api/v3/MembershipStatus.php:138 [7] => CRM/Core/StateMachine.php:397 [8] => CRM/Contact/BAO/GroupOrganization.php:98 [9] => CRM/Contact/BAO/GroupOrganization.php:126 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php' 193 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php' 212 edit_at_line 'CRM/Core/BAO/Location.php' 219 edit_at_line 'CRM/Core/BAO/Block.php' 136 edit_at_line 'CRM/Core/BAO/Block.php' 156 edit_at_line 'CRM/Core/BAO/Block.php' 521 edit_at_line 'api/v3/MembershipStatus.php' 138 edit_at_line 'CRM/Core/StateMachine.php' 397 edit_at_line 'CRM/Contact/BAO/GroupOrganization.php' 98 edit_at_line 'CRM/Contact/BAO/GroupOrganization.php' 126 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"format\" [1] => Visibility must be declared on method \"getCustomOption\" [2] => Visibility must be declared on method \"dupesByParams\" [3] => Visibility must be declared on method \"run\" [4] => Visibility must be declared on method \"preProcess\" [5] => Visibility must be declared on method \"all\" [6] => Visibility must be declared on method \"__construct\" [7] => Visibility must be declared on method \"invoke\" [8] => Visibility must be declared on method \"buildQuickForm\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/Address.php:58 [1] => CRM/Core/BAO/CustomOption.php:73 [2] => CRM/Dedupe/Finder.php:98 [3] => CRM/Custom/Import/Parser.php:77 [4] => CRM/Campaign/Form/Search/Survey.php:53 [5] => CRM/Contact/Form/Search/Custom/EventAggregate.php:113 [6] => CRM/Contact/Form/Search/Custom/RandomSegment.php:134 [7] => CRM/Contact/Form/Search/Custom/ContribSYBNT.php:147 [8] => CRM/Case/Selector/Search.php:144 [9] => CRM/Utils/Hook/UnitTests.php:108 [10] => CRM/Core/Form/Tag.php:63 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Address.php' 58 edit_at_line 'CRM/Core/BAO/CustomOption.php' 73 edit_at_line 'CRM/Dedupe/Finder.php' 98 edit_at_line 'CRM/Custom/Import/Parser.php' 77 edit_at_line 'CRM/Campaign/Form/Search/Survey.php' 53 edit_at_line 'CRM/Contact/Form/Search/Custom/EventAggregate.php' 113 edit_at_line 'CRM/Contact/Form/Search/Custom/RandomSegment.php' 134 edit_at_line 'CRM/Contact/Form/Search/Custom/ContribSYBNT.php' 147 edit_at_line 'CRM/Case/Selector/Search.php' 144 edit_at_line 'CRM/Utils/Hook/UnitTests.php' 108 edit_at_line 'CRM/Core/Form/Tag.php' 63 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' 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/Utils/Address.php:69 [1] => CRM/Utils/Address.php:74 [2] => CRM/Utils/OpenFlashChart.php:455 [3] => CRM/Contact/Page/View/GroupContact.php:179 [4] => CRM/Contribute/Form/AdditionalPayment.php:432 [5] => CRM/Event/Form/Registration/Register.php:258 [6] => CRM/Dedupe/BAO/RuleGroup.php:454 [7] => CRM/Event/Form/ManageEvent/Fee.php:150 [8] => CRM/Case/Form/Case.php:162 ) ' echo '' echo 'Total number of edits to perform: 9' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Address.php' 69 edit_at_line 'CRM/Utils/Address.php' 74 edit_at_line 'CRM/Utils/OpenFlashChart.php' 455 edit_at_line 'CRM/Contact/Page/View/GroupContact.php' 179 edit_at_line 'CRM/Contribute/Form/AdditionalPayment.php' 432 edit_at_line 'CRM/Event/Form/Registration/Register.php' 258 edit_at_line 'CRM/Dedupe/BAO/RuleGroup.php' 454 edit_at_line 'CRM/Event/Form/ManageEvent/Fee.php' 150 edit_at_line 'CRM/Case/Form/Case.php' 162 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $inactiveNeededDo does not match actual variable name $inactiveNeeded ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/CustomOption.php:67 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomOption.php' 67 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Formatting.SpaceUnaryOperator.BooleanNot' echo 'Messages:Array ( [0] => A unary operator statement must not be followed by a space ) ' echo 'Lines:Array ( [0] => api/v3/UFField.php:62 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/UFField.php' 62 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.SpaceUnaryOperator.BooleanNot!' 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/UFField.php:113 [1] => CRM/Contact/Page/View/Relationship.php:138 [2] => CRM/Contact/Page/View/Relationship.php:147 [3] => CRM/Contact/Page/View/Relationship.php:263 [4] => CRM/Contact/Page/View/GroupContact.php:40 [5] => CRM/Contact/Page/View/GroupContact.php:77 [6] => CRM/Core/BAO/PreferencesDate.php:78 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/UFField.php' 113 edit_at_line 'CRM/Contact/Page/View/Relationship.php' 138 edit_at_line 'CRM/Contact/Page/View/Relationship.php' 147 edit_at_line 'CRM/Contact/Page/View/Relationship.php' 263 edit_at_line 'CRM/Contact/Page/View/GroupContact.php' 40 edit_at_line 'CRM/Contact/Page/View/GroupContact.php' 77 edit_at_line 'CRM/Core/BAO/PreferencesDate.php' 78 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Form/AdditionalPayment.php:336 [1] => api/v3/MailingEventSubscribe.php:67 [2] => CRM/Event/Form/Registration/Register.php:753 [3] => CRM/Event/Form/Task/Batch.php:141 [4] => CRM/Campaign/BAO/Petition.php:639 [5] => CRM/Contact/Form/Search/Custom/ContribSYBNT.php:193 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/AdditionalPayment.php' 336 edit_at_line 'api/v3/MailingEventSubscribe.php' 67 edit_at_line 'CRM/Event/Form/Registration/Register.php' 753 edit_at_line 'CRM/Event/Form/Task/Batch.php' 141 edit_at_line 'CRM/Campaign/BAO/Petition.php' 639 edit_at_line 'CRM/Contact/Form/Search/Custom/ContribSYBNT.php' 193 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' 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/MailingContact.php:63 [1] => api/v3/MailingContact.php:84 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/MailingContact.php' 63 edit_at_line 'api/v3/MailingContact.php' 63 edit_at_line 'api/v3/MailingContact.php' 84 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.NoSpace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Generic.Formatting.SpaceAfterCast.NoSpace' echo 'Messages:Array ( [0] => A cast statement must be followed by a single space ) ' echo 'Lines:Array ( [0] => api/v3/MailingEventSubscribe.php:58 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/MailingEventSubscribe.php' 58 echo '===============================================================' echo '' echo 'Completed formatting issue Generic.Formatting.SpaceAfterCast.NoSpace!' 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/Dedupe/BAO/RuleGroup.php:415 [1] => CRM/Case/Audit/Audit.php:221 [2] => CRM/Case/Selector/Search.php:187 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Dedupe/BAO/RuleGroup.php' 415 edit_at_line 'CRM/Case/Audit/Audit.php' 221 edit_at_line 'CRM/Case/Selector/Search.php' 187 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.PHP.NonExecutableCode.ReturnNotRequired' echo 'Messages:Array ( [0] => Empty return statement not required here ) ' echo 'Lines:Array ( [0] => CRM/Core/Smarty/plugins/function.isValueChange.php:88 [1] => CRM/Contact/Form/Search/Custom/RandomSegment.php:379 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Smarty/plugins/function.isValueChange.php' 88 edit_at_line 'CRM/Contact/Form/Search/Custom/RandomSegment.php' 379 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' 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 ) ' echo 'Lines:Array ( [0] => CRM/Case/Form/Activity.php:286 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Case/Form/Activity.php' 286 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi