#!/bin/bash ## usage: bash batch-16.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: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"__construct\" [1] => Visibility must be declared on method \"links\" [2] => Visibility must be declared on method \"defaultReturnProperties\" [3] => Visibility must be declared on method \"createTestObject\" [4] => Visibility must be declared on method \"testMembershipUpdateCreateHookCRM15746\" [5] => Visibility must be declared on method \"hook_civicrm_pre_update_create_membership\" [6] => Visibility must be declared on method \"buildQuickForm\" [7] => Visibility must be declared on method \"all\" [8] => Visibility must be declared on method \"preProcess\" [9] => Visibility must be declared on method \"exportComponents\" [10] => Visibility must be declared on method \"_trimNonTokens\" [11] => Visibility must be declared on method \"processContribution\" [12] => Visibility must be declared on method \"actionLinks\" ) ' echo 'Lines:Array ( [0] => CRM/Member/Selector/Search.php:146 [1] => CRM/Member/Selector/Search.php:194 [2] => CRM/Event/BAO/Query.php:470 [3] => tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php:227 [4] => CRM/Campaign/Selector/Search.php:148 [5] => CRM/Grant/BAO/Query.php:334 [6] => tests/phpunit/api/v3/MembershipTest.php:836 [7] => tests/phpunit/api/v3/MembershipTest.php:846 [8] => tests/extensions/test.extension.manager.reporttest/main.php:9 [9] => tests/extensions/test.extension.manager.reporttest/main.php:28 [10] => CRM/Contact/Form/Search/Custom/Basic.php:158 [11] => CRM/Campaign/Form/Task/Release.php:70 [12] => CRM/Campaign/Form/SurveyType.php:71 [13] => CRM/Export/BAO/Export.php:76 [14] => CRM/Export/BAO/Export.php:1695 [15] => CRM/Campaign/Form/Search/Campaign.php:53 [16] => CRM/Event/Form/Registration/Confirm.php:961 [17] => CRM/Contact/Form/Search/Custom/Group.php:186 [18] => CRM/Contribute/Form/Search.php:78 [19] => CRM/UF/Page/Field.php:67 ) ' echo '' echo 'Total number of edits to perform: 20' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/Selector/Search.php' 146 edit_at_line 'CRM/Member/Selector/Search.php' 194 edit_at_line 'CRM/Event/BAO/Query.php' 470 edit_at_line 'tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php' 227 edit_at_line 'CRM/Campaign/Selector/Search.php' 148 edit_at_line 'CRM/Grant/BAO/Query.php' 334 edit_at_line 'tests/phpunit/api/v3/MembershipTest.php' 836 edit_at_line 'tests/phpunit/api/v3/MembershipTest.php' 846 edit_at_line 'tests/extensions/test.extension.manager.reporttest/main.php' 9 edit_at_line 'tests/extensions/test.extension.manager.reporttest/main.php' 28 edit_at_line 'CRM/Contact/Form/Search/Custom/Basic.php' 158 edit_at_line 'CRM/Campaign/Form/Task/Release.php' 70 edit_at_line 'CRM/Campaign/Form/SurveyType.php' 71 edit_at_line 'CRM/Export/BAO/Export.php' 76 edit_at_line 'CRM/Export/BAO/Export.php' 1695 edit_at_line 'CRM/Campaign/Form/Search/Campaign.php' 53 edit_at_line 'CRM/Event/Form/Registration/Confirm.php' 961 edit_at_line 'CRM/Contact/Form/Search/Custom/Group.php' 186 edit_at_line 'CRM/Contribute/Form/Search.php' 78 edit_at_line 'CRM/UF/Page/Field.php' 67 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' 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/Member/Selector/Search.php:192 [1] => CRM/Case/Page/Tab.php:227 [2] => CRM/Campaign/Selector/Search.php:185 [3] => CRM/Contact/Form/Task/LabelCommon.php:86 [4] => CRM/Admin/Form/Setting/Miscellaneous.php:60 [5] => CRM/Contribute/BAO/ManagePremiums.php:135 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/Selector/Search.php' 192 edit_at_line 'CRM/Case/Page/Tab.php' 227 edit_at_line 'CRM/Campaign/Selector/Search.php' 185 edit_at_line 'CRM/Contact/Form/Task/LabelCommon.php' 86 edit_at_line 'CRM/Admin/Form/Setting/Miscellaneous.php' 60 edit_at_line 'CRM/Contribute/BAO/ManagePremiums.php' 135 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' 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: '\''js/angular-crmMailing/directives.js'\'' [1] => A comma should follow the last multiline array item. Found: '\''js/angular-crmMailingAB/directives.js'\'' [2] => A comma should follow the last multiline array item. Found: '\''email'\'' [3] => A comma should follow the last multiline array item. Found: '\''membership_type_id'\'' [4] => A comma should follow the last multiline array item. Found: $threshold [5] => A comma should follow the last multiline array item. Found: $title [6] => A comma should follow the last multiline array item. Found: '\''is_required'\'' [7] => A comma should follow the last multiline array item. Found: _contactId [8] => A comma should follow the last multiline array item. Found: '\''membership_type'\'' [9] => A comma should follow the last multiline array item. Found: ) [10] => A comma should follow the last multiline array item. Found: '\''%count contacts un-tagged'\'' [11] => A comma should follow the last multiline array item. Found: '\''%count contacts already did not have this tag'\'' [12] => A comma should follow the last multiline array item. Found: \"{$name} campaign contacts\" [13] => A comma should follow the last multiline array item. Found: id [14] => A comma should follow the last multiline array item. Found: $op [15] => A comma should follow the last multiline array item. Found: '\''String'\'' [16] => A comma should follow the last multiline array item. Found: $inValidSubtypeCnt [17] => A comma should follow the last multiline array item. Found: '\''openid'\'' [18] => A comma should follow the last multiline array item. Found: '\''country'\'' [19] => A comma should follow the last multiline array item. Found: '\''interviewerId'\'' [20] => A comma should follow the last multiline array item. Found: '\''Scheduled'\'' [21] => A comma should follow the last multiline array item. Found: '\''participant_status_id'\'' [22] => A comma should follow the last multiline array item. Found: '\''%count activities un-tagged'\'' [23] => A comma should follow the last multiline array item. Found: '\''%count activities already did not have this tag'\'' [24] => A comma should follow the last multiline array item. Found: _id [25] => A comma should follow the last multiline array item. Found: $file [26] => A comma should follow the last multiline array item. Found: $method [27] => A comma should follow the last multiline array item. Found: '\''name'\'' [28] => A comma should follow the last multiline array item. Found: TRUE [29] => A comma should follow the last multiline array item. Found: 1 [30] => A comma should follow the last multiline array item. Found: '\''civicrm_membership'\'' [31] => A comma should follow the last multiline array item. Found: '\''edit'\'' [32] => A comma should follow the last multiline array item. Found: '\''delete'\'' [33] => A comma should follow the last multiline array item. Found: '\''You know, a lotta ins, a lotta outs, a lotta what-have-yous.'\'' [34] => A comma should follow the last multiline array item. Found: '\''The Dude abides.'\'' [35] => A comma should follow the last multiline array item. Found: '\''last_name'\'' [36] => A comma should follow the last multiline array item. Found: '\''contribution_amount_high'\'' [37] => A comma should follow the last multiline array item. Found: '\''contribution_trxn_id'\'' [38] => A comma should follow the last multiline array item. Found: '\''downloadSoftCreditErrorRecordsUrl'\'' ) ' echo 'Lines:Array ( [0] => CRM/Mailing/Info.php:67 [1] => CRM/Mailing/Info.php:76 [2] => CRM/Mailing/Info.php:142 [3] => CRM/Member/Import/Form/MapField.php:98 [4] => CRM/Member/Import/Form/MapField.php:365 [5] => CRM/Member/Import/Form/MapField.php:374 [6] => CRM/Profile/Page/MultipleRecordFieldsListing.php:229 [7] => CRM/Profile/Page/MultipleRecordFieldsListing.php:355 [8] => CRM/Member/Page/UserDashboard.php:61 [9] => CRM/Mailing/Form/Test.php:329 [10] => CRM/Contact/Form/Task/RemoveFromTag.php:140 [11] => CRM/Contact/Form/Task/RemoveFromTag.php:141 [12] => CRM/Contact/Form/Task/RemoveFromTag.php:146 [13] => CRM/Campaign/Page/Vote.php:101 [14] => CRM/Campaign/Page/Vote.php:122 [15] => CRM/Campaign/Page/Vote.php:123 [16] => tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php:92 [17] => tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php:155 [18] => CRM/Grant/BAO/Query.php:215 [19] => CRM/Grant/BAO/Query.php:251 [20] => CRM/Contact/BAO/RelationshipType.php:167 [21] => CRM/Contact/BAO/RelationshipType.php:168 [22] => CRM/Contact/Form/Task/Batch.php:261 [23] => CRM/Contact/Form/Task/LabelCommon.php:217 [24] => CRM/Contact/Form/Search/Custom/Basic.php:75 [25] => CRM/Contact/Form/Edit/CommunicationPreferences.php:121 [26] => CRM/Contact/Form/Search/Basic.php:89 [27] => CRM/Contact/Form/Search/Basic.php:100 [28] => CRM/Contact/Form/Search/Criteria.php:161 [29] => CRM/Campaign/Form/Task/Release.php:77 [30] => CRM/Campaign/Form/Task/Release.php:110 [31] => CRM/Event/Form/Task/Delete.php:130 [32] => CRM/Event/Form/Task/Delete.php:131 [33] => CRM/Event/Import/Form/MapField.php:90 [34] => CRM/Event/Import/Form/MapField.php:346 [35] => CRM/Activity/Form/Task/RemoveFromTag.php:140 [36] => CRM/Activity/Form/Task/RemoveFromTag.php:141 [37] => CRM/Activity/Form/Task/RemoveFromTag.php:146 [38] => CRM/Admin/Form/PaymentProcessor.php:186 [39] => CRM/Extension/Manager/Payment.php:200 [40] => CRM/Extension/Manager/Payment.php:211 [41] => CRM/Extension/Manager/Payment.php:291 [42] => tests/phpunit/CRM/Core/PseudoConstantTest.php:73 [43] => tests/phpunit/CRM/Core/PseudoConstantTest.php:1086 [44] => tests/phpunit/CRM/Core/PseudoConstantTest.php:1093 [45] => tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php:54 [46] => tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php:78 [47] => tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php:85 [48] => tests/phpunit/CRM/Core/MenuTest.php:20 [49] => tests/phpunit/CRM/Core/MenuTest.php:29 [50] => tests/phpunit/CRM/Core/MenuTest.php:39 [51] => CRM/Campaign/Form/Search/Campaign.php:98 [52] => CRM/Campaign/Form/Search/Campaign.php:109 [53] => CRM/Financial/Form/FinancialBatch.php:67 [54] => CRM/Financial/Form/FinancialBatch.php:74 [55] => tests/phpunit/CRM/Utils/API/MatchOptionTest.php:192 [56] => tests/phpunit/CRM/Utils/API/MatchOptionTest.php:272 [57] => tests/phpunit/CRM/Utils/API/MatchOptionTest.php:277 [58] => tests/phpunit/CRM/Queue/QueueTest.php:49 [59] => tests/phpunit/CRM/Queue/QueueTest.php:55 [60] => CRM/Event/Form/Registration/Confirm.php:242 [61] => CRM/Contribute/Form/Search.php:263 [62] => CRM/Contribute/Form/Search.php:277 [63] => CRM/Activity/Form/Task/PickOption.php:84 [64] => CRM/Contribute/Import/Form/Summary.php:125 ) ' echo '' echo 'Total number of edits to perform: 65' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Mailing/Info.php' 67 edit_at_line 'CRM/Mailing/Info.php' 76 edit_at_line 'CRM/Mailing/Info.php' 142 edit_at_line 'CRM/Member/Import/Form/MapField.php' 98 edit_at_line 'CRM/Member/Import/Form/MapField.php' 365 edit_at_line 'CRM/Member/Import/Form/MapField.php' 374 edit_at_line 'CRM/Profile/Page/MultipleRecordFieldsListing.php' 229 edit_at_line 'CRM/Profile/Page/MultipleRecordFieldsListing.php' 355 edit_at_line 'CRM/Member/Page/UserDashboard.php' 61 edit_at_line 'CRM/Mailing/Form/Test.php' 329 edit_at_line 'CRM/Contact/Form/Task/RemoveFromTag.php' 140 edit_at_line 'CRM/Contact/Form/Task/RemoveFromTag.php' 141 edit_at_line 'CRM/Contact/Form/Task/RemoveFromTag.php' 146 edit_at_line 'CRM/Campaign/Page/Vote.php' 101 edit_at_line 'CRM/Campaign/Page/Vote.php' 122 edit_at_line 'CRM/Campaign/Page/Vote.php' 123 edit_at_line 'tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php' 92 edit_at_line 'tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php' 155 edit_at_line 'CRM/Grant/BAO/Query.php' 215 edit_at_line 'CRM/Grant/BAO/Query.php' 251 edit_at_line 'CRM/Contact/BAO/RelationshipType.php' 167 edit_at_line 'CRM/Contact/BAO/RelationshipType.php' 168 edit_at_line 'CRM/Contact/Form/Task/Batch.php' 261 edit_at_line 'CRM/Contact/Form/Task/LabelCommon.php' 217 edit_at_line 'CRM/Contact/Form/Search/Custom/Basic.php' 75 edit_at_line 'CRM/Contact/Form/Edit/CommunicationPreferences.php' 121 edit_at_line 'CRM/Contact/Form/Search/Basic.php' 89 edit_at_line 'CRM/Contact/Form/Search/Basic.php' 100 edit_at_line 'CRM/Contact/Form/Search/Criteria.php' 161 edit_at_line 'CRM/Campaign/Form/Task/Release.php' 77 edit_at_line 'CRM/Campaign/Form/Task/Release.php' 110 edit_at_line 'CRM/Event/Form/Task/Delete.php' 130 edit_at_line 'CRM/Event/Form/Task/Delete.php' 131 edit_at_line 'CRM/Event/Import/Form/MapField.php' 90 edit_at_line 'CRM/Event/Import/Form/MapField.php' 346 edit_at_line 'CRM/Activity/Form/Task/RemoveFromTag.php' 140 edit_at_line 'CRM/Activity/Form/Task/RemoveFromTag.php' 141 edit_at_line 'CRM/Activity/Form/Task/RemoveFromTag.php' 146 edit_at_line 'CRM/Admin/Form/PaymentProcessor.php' 186 edit_at_line 'CRM/Extension/Manager/Payment.php' 200 edit_at_line 'CRM/Extension/Manager/Payment.php' 211 edit_at_line 'CRM/Extension/Manager/Payment.php' 291 edit_at_line 'tests/phpunit/CRM/Core/PseudoConstantTest.php' 73 edit_at_line 'tests/phpunit/CRM/Core/PseudoConstantTest.php' 1086 edit_at_line 'tests/phpunit/CRM/Core/PseudoConstantTest.php' 1093 edit_at_line 'tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php' 54 edit_at_line 'tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php' 78 edit_at_line 'tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php' 85 edit_at_line 'tests/phpunit/CRM/Core/MenuTest.php' 20 edit_at_line 'tests/phpunit/CRM/Core/MenuTest.php' 29 edit_at_line 'tests/phpunit/CRM/Core/MenuTest.php' 39 edit_at_line 'CRM/Campaign/Form/Search/Campaign.php' 98 edit_at_line 'CRM/Campaign/Form/Search/Campaign.php' 109 edit_at_line 'CRM/Financial/Form/FinancialBatch.php' 67 edit_at_line 'CRM/Financial/Form/FinancialBatch.php' 74 edit_at_line 'tests/phpunit/CRM/Utils/API/MatchOptionTest.php' 192 edit_at_line 'tests/phpunit/CRM/Utils/API/MatchOptionTest.php' 272 edit_at_line 'tests/phpunit/CRM/Utils/API/MatchOptionTest.php' 277 edit_at_line 'tests/phpunit/CRM/Queue/QueueTest.php' 49 edit_at_line 'tests/phpunit/CRM/Queue/QueueTest.php' 55 edit_at_line 'CRM/Event/Form/Registration/Confirm.php' 242 edit_at_line 'CRM/Contribute/Form/Search.php' 263 edit_at_line 'CRM/Contribute/Form/Search.php' 277 edit_at_line 'CRM/Activity/Form/Task/PickOption.php' 84 edit_at_line 'CRM/Contribute/Import/Form/Summary.php' 125 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/Profile/Page/Router.php:51 [1] => CRM/Contact/Form/Task/Batch.php:173 [2] => CRM/Admin/Form/PaymentProcessor.php:351 [3] => CRM/Utils/Mail/Incoming.php:327 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Profile/Page/Router.php' 51 edit_at_line 'CRM/Contact/Form/Task/Batch.php' 173 edit_at_line 'CRM/Admin/Form/PaymentProcessor.php' 351 edit_at_line 'CRM/Utils/Mail/Incoming.php' 327 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' 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/Profile/Page/Router.php:78 [1] => CRM/Profile/Page/MultipleRecordFieldsListing.php:252 [2] => CRM/Case/Page/Tab.php:120 [3] => CRM/Contact/Form/Edit/CommunicationPreferences.php:190 [4] => CRM/Export/BAO/Export.php:325 [5] => CRM/Campaign/Form/Survey.php:131 [6] => CRM/Event/Form/Registration/Confirm.php:643 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Profile/Page/Router.php' 78 edit_at_line 'CRM/Profile/Page/MultipleRecordFieldsListing.php' 252 edit_at_line 'CRM/Case/Page/Tab.php' 120 edit_at_line 'CRM/Contact/Form/Edit/CommunicationPreferences.php' 190 edit_at_line 'CRM/Export/BAO/Export.php' 325 edit_at_line 'CRM/Campaign/Form/Survey.php' 131 edit_at_line 'CRM/Event/Form/Registration/Confirm.php' 643 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' 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/Profile/Page/Router.php:129 [1] => CRM/Contact/Form/Search/Custom/Basic.php:115 [2] => CRM/Contact/Form/Search/Basic.php:246 [3] => CRM/Core/Session.php:147 [4] => CRM/Core/Session.php:170 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Profile/Page/Router.php' 129 edit_at_line 'CRM/Contact/Form/Search/Custom/Basic.php' 115 edit_at_line 'CRM/Contact/Form/Search/Basic.php' 246 edit_at_line 'CRM/Core/Session.php' 147 edit_at_line 'CRM/Core/Session.php' 170 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' 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/Member/Page/UserDashboard.php:44 [1] => CRM/Member/Page/UserDashboard.php:99 [2] => CRM/Case/Page/Tab.php:143 [3] => CRM/Core/BAO/PaperSize.php:95 [4] => CRM/Contact/Form/Task/LabelCommon.php:53 [5] => CRM/Admin/Form/PaymentProcessor.php:374 [6] => CRM/Financial/Form/FinancialBatch.php:299 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/Page/UserDashboard.php' 44 edit_at_line 'CRM/Member/Page/UserDashboard.php' 99 edit_at_line 'CRM/Case/Page/Tab.php' 143 edit_at_line 'CRM/Core/BAO/PaperSize.php' 95 edit_at_line 'CRM/Contact/Form/Task/LabelCommon.php' 53 edit_at_line 'CRM/Admin/Form/PaymentProcessor.php' 374 edit_at_line 'CRM/Financial/Form/FinancialBatch.php' 299 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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] => CRM/Mailing/Form/Test.php:180 [1] => tests/phpunit/CiviTest/Custom.php:115 [2] => tests/phpunit/CiviTest/PaypalPro.php:48 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Mailing/Form/Test.php' 180 edit_at_line 'tests/phpunit/CiviTest/Custom.php' 115 edit_at_line 'tests/phpunit/CiviTest/PaypalPro.php' 48 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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 12 spaces but found 16 [3] => Array indentation error, expected 6 spaces but found 8 ) ' echo 'Lines:Array ( [0] => CRM/Mailing/Form/Test.php:269 [1] => CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php:164 [2] => CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php:165 [3] => CRM/ACL/Form/ACLBasic.php:98 [4] => CRM/ACL/Form/ACLBasic.php:99 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Mailing/Form/Test.php' 269 edit_at_line 'CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php' 164 edit_at_line 'CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php' 165 edit_at_line 'CRM/ACL/Form/ACLBasic.php' 98 edit_at_line 'CRM/ACL/Form/ACLBasic.php' 99 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' 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/LocBlock.php:47 [1] => api/v3/LocBlock.php:98 [2] => api/v3/LocBlock.php:136 [3] => tests/phpunit/CiviTest/PaypalPro.php:14 [4] => tests/phpunit/CiviTest/PaypalPro.php:15 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/LocBlock.php' 47 edit_at_line 'api/v3/LocBlock.php' 98 edit_at_line 'api/v3/LocBlock.php' 136 edit_at_line 'tests/phpunit/CiviTest/PaypalPro.php' 14 edit_at_line 'tests/phpunit/CiviTest/PaypalPro.php' 15 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/Custom.php:104 [1] => tests/phpunit/CiviTest/Custom.php:114 [2] => CRM/Core/BAO/PaperSize.php:73 [3] => CRM/Core/BAO/PaperSize.php:136 [4] => CRM/Campaign/Form/SurveyType.php:67 [5] => CRM/Campaign/Form/SurveyType.php:101 [6] => CRM/Campaign/Form/Survey.php:95 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/Custom.php' 104 edit_at_line 'tests/phpunit/CiviTest/Custom.php' 114 edit_at_line 'CRM/Core/BAO/PaperSize.php' 73 edit_at_line 'CRM/Core/BAO/PaperSize.php' 136 edit_at_line 'CRM/Campaign/Form/SurveyType.php' 67 edit_at_line 'CRM/Campaign/Form/SurveyType.php' 101 edit_at_line 'CRM/Campaign/Form/Survey.php' 95 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/Contact/BAO/Contact/Location.php:54 [1] => CRM/Contact/BAO/Contact/Location.php:98 [2] => CRM/Contact/BAO/RelationshipType.php:149 [3] => CRM/Contact/Form/Task/Batch.php:123 [4] => CRM/Contact/Form/Edit/CommunicationPreferences.php:58 [5] => CRM/Contact/Form/Search/Criteria.php:118 [6] => CRM/Contact/Form/Search/Criteria.php:490 [7] => CRM/Event/Form/Task/Delete.php:81 [8] => CRM/Event/Import/Form/MapField.php:161 [9] => CRM/Contact/Form/Search/Custom/Group.php:71 [10] => CRM/Contact/Form/Search/Custom/Group.php:357 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/Contact/Location.php' 54 edit_at_line 'CRM/Contact/BAO/Contact/Location.php' 98 edit_at_line 'CRM/Contact/BAO/RelationshipType.php' 149 edit_at_line 'CRM/Contact/Form/Task/Batch.php' 123 edit_at_line 'CRM/Contact/Form/Edit/CommunicationPreferences.php' 58 edit_at_line 'CRM/Contact/Form/Search/Criteria.php' 118 edit_at_line 'CRM/Contact/Form/Search/Criteria.php' 490 edit_at_line 'CRM/Event/Form/Task/Delete.php' 81 edit_at_line 'CRM/Event/Import/Form/MapField.php' 161 edit_at_line 'CRM/Contact/Form/Search/Custom/Group.php' 71 edit_at_line 'CRM/Contact/Form/Search/Custom/Group.php' 357 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 ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/Contact/Location.php:200 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/Contact/Location.php' 200 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.SpaceInlineIf.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Arrays.ArrayDeclaration.SpaceAfterComma' echo 'Messages:Array ( [0] => Expected 1 space between comma and \"'\''event_is_public'\''\"; 2 found ) ' echo 'Lines:Array ( [0] => CRM/Event/BAO/Query.php:383 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/BAO/Query.php' 383 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Arrays.ArrayDeclaration.SpaceAfterComma!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.Comma.TooManySpaces' echo 'Messages:Array ( [0] => Expected one space after the comma, 2 found ) ' echo 'Lines:Array ( [0] => CRM/Event/BAO/Query.php:383 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/BAO/Query.php' 383 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.TooManySpaces!' 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/Campaign/Selector/Search.php:310 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Selector/Search.php' 310 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' 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/MembershipTest.php:632 [1] => tests/phpunit/api/v3/EntityTagTest.php:123 [2] => tests/phpunit/api/v3/EntityTagTest.php:182 [3] => tests/phpunit/api/v3/EntityTagTest.php:257 [4] => tests/phpunit/WebTest/Import/ContactTest.php:41 [5] => tests/phpunit/WebTest/Import/ContactTest.php:128 [6] => tests/phpunit/WebTest/Import/ContactTest.php:209 [7] => tests/phpunit/WebTest/Import/ContactSubtypeTest.php:41 [8] => tests/phpunit/WebTest/Import/ContactSubtypeTest.php:123 [9] => tests/phpunit/WebTest/Import/ContactSubtypeTest.php:199 [10] => tests/phpunit/WebTest/Import/DuplicateMatchingTest.php:41 [11] => tests/phpunit/WebTest/Import/DuplicateMatchingTest.php:142 [12] => tests/phpunit/WebTest/Import/DuplicateMatchingTest.php:237 [13] => tests/phpunit/CRM/Queue/QueueTest.php:61 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/MembershipTest.php' 632 edit_at_line 'tests/phpunit/api/v3/EntityTagTest.php' 123 edit_at_line 'tests/phpunit/api/v3/EntityTagTest.php' 182 edit_at_line 'tests/phpunit/api/v3/EntityTagTest.php' 257 edit_at_line 'tests/phpunit/WebTest/Import/ContactTest.php' 41 edit_at_line 'tests/phpunit/WebTest/Import/ContactTest.php' 128 edit_at_line 'tests/phpunit/WebTest/Import/ContactTest.php' 209 edit_at_line 'tests/phpunit/WebTest/Import/ContactSubtypeTest.php' 41 edit_at_line 'tests/phpunit/WebTest/Import/ContactSubtypeTest.php' 123 edit_at_line 'tests/phpunit/WebTest/Import/ContactSubtypeTest.php' 199 edit_at_line 'tests/phpunit/WebTest/Import/DuplicateMatchingTest.php' 41 edit_at_line 'tests/phpunit/WebTest/Import/DuplicateMatchingTest.php' 142 edit_at_line 'tests/phpunit/WebTest/Import/DuplicateMatchingTest.php' 237 edit_at_line 'tests/phpunit/CRM/Queue/QueueTest.php' 61 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayClosingIndentation' echo 'Messages:Array ( [0] => Array closing indentation error, expected 10 spaces but found 12 [1] => Array closing indentation error, expected 4 spaces but found 6 ) ' echo 'Lines:Array ( [0] => CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php:166 [1] => CRM/ACL/Form/ACLBasic.php:100 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php' 166 edit_at_line 'CRM/ACL/Form/ACLBasic.php' 100 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' 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] => tests/extensions/test.extension.manager.reporttest/main.php:10 [1] => CRM/ACL/BAO/ACL.php:115 [2] => CRM/Admin/Form/Setting/Miscellaneous.php:81 [3] => CRM/Admin/Form/Setting/Miscellaneous.php:169 [4] => CRM/Core/Session.php:98 [5] => CRM/Report/Form/Contribute/LoggingDetail.php:39 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'tests/extensions/test.extension.manager.reporttest/main.php' 10 edit_at_line 'CRM/ACL/BAO/ACL.php' 115 edit_at_line 'CRM/Admin/Form/Setting/Miscellaneous.php' 81 edit_at_line 'CRM/Admin/Form/Setting/Miscellaneous.php' 169 edit_at_line 'CRM/Core/Session.php' 98 edit_at_line 'CRM/Report/Form/Contribute/LoggingDetail.php' 39 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => join() is a function name alias, use implode() instead ) ' echo 'Lines:Array ( [0] => CRM/ACL/BAO/ACL.php:824 [1] => CRM/ACL/BAO/ACL.php:828 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/ACL/BAO/ACL.php' 824 edit_at_line 'CRM/ACL/BAO/ACL.php' 828 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' 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/Campaign/Form/Survey.php:154 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Form/Survey.php' 154 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' echo '' echo 'Yay!' echo '' fi