#!/bin/bash ## usage: bash batch-18.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.Array.Array' echo 'Messages:Array ( [0] => A comma should follow the last multiline array item. Found: ) [1] => A comma should follow the last multiline array item. Found: '\''activity_subject'\'' [2] => A comma should follow the last multiline array item. Found: FALSE [3] => A comma should follow the last multiline array item. Found: ] [4] => A comma should follow the last multiline array item. Found: _id [5] => A comma should follow the last multiline array item. Found: '\''Rejected'\'' [6] => A comma should follow the last multiline array item. Found: 1 [7] => A comma should follow the last multiline array item. Found: $count_success [8] => A comma should follow the last multiline array item. Found: '\''%count Messages Not Sent'\'' [9] => A comma should follow the last multiline array item. Found: '\''amtg'\'' [10] => A comma should follow the last multiline array item. Found: '\''contact_id'\'' [11] => A comma should follow the last multiline array item. Found: '\''%count emails were found on hold and updated.'\'' [12] => A comma should follow the last multiline array item. Found: '\''None of the selected contacts have an email on hold.'\'' [13] => A comma should follow the last multiline array item. Found: '\''action'\'' [14] => A comma should follow the last multiline array item. Found: '\''pcp_personal_note'\'' [15] => A comma should follow the last multiline array item. Found: '\''postal_greeting'\'' [16] => A comma should follow the last multiline array item. Found: '\''household_name'\'' [17] => A comma should follow the last multiline array item. Found: '\''trxn_id'\'' [18] => A comma should follow the last multiline array item. Found: '\''external_identifier'\'' [19] => A comma should follow the last multiline array item. Found: '\''*'\'' [20] => A comma should follow the last multiline array item. Found: '\''xmlrpc_errors'\'' [21] => A comma should follow the last multiline array item. Found: \"/Mandatory key\\(s\\) missing from params array: '\''id'\'' or '\''entity_table/\" [22] => A comma should follow the last multiline array item. Found: '\''is_sms'\'' [23] => A comma should follow the last multiline array item. Found: '\''mailings'\'' [24] => A comma should follow the last multiline array item. Found: NULL [25] => A comma should follow the last multiline array item. Found: '\''2010-12-20'\'' [26] => A comma should follow the last multiline array item. Found: '\''CTO'\'' [27] => A comma should follow the last multiline array item. Found: '\''data'\'' [28] => A comma should follow the last multiline array item. Found: '\''membership_type_id'\'' [29] => A comma should follow the last multiline array item. Found: '\''pick-me-disabled'\'' [30] => A comma should follow the last multiline array item. Found: '\''pick-me-active'\'' [31] => A comma should follow the last multiline array item. Found: '\''Mailing is not forwarded to the given email addresses.'\'' [32] => A comma should follow the last multiline array item. Found: '\''Mailing is forwarded successfully to %count email addresses.'\'' [33] => A comma should follow the last multiline array item. Found: '\''hidden_find_mailings'\'' [34] => A comma should follow the last multiline array item. Found: '\''mailing_to'\'' [35] => A comma should follow the last multiline array item. Found: '\''{crmScope x=1}x={$x} {crmScope x=2}x={$x} {crmScope x=3}x={$x}{/crmScope} x={$x}{/crmScope} x={$x}{/crmScope}'\'' [36] => A comma should follow the last multiline array item. Found: '\''{crmScope x=1 y=9}x={$x},y={$y} {crmScope y=8}x={$x},y={$y}{/crmScope} x={$x},y={$y}{/crmScope}'\'' [37] => A comma should follow the last multiline array item. Found: 2 [38] => A comma should follow the last multiline array item. Found: '\''target_entity_id'\'' [39] => A comma should follow the last multiline array item. Found: $endId ) ' echo 'Lines:Array ( [0] => CRM/Batch/Form/Entry.php:205 [1] => CRM/Batch/Form/Entry.php:256 [2] => CRM/Admin/Form/MessageTemplates.php:147 [3] => CRM/Admin/Form/MessageTemplates.php:191 [4] => CRM/Activity/Import/Form/MapField.php:75 [5] => CRM/Activity/Import/Form/MapField.php:198 [6] => CRM/Activity/Form/Task/PickProfile.php:79 [7] => CRM/Activity/Form/Task/PickProfile.php:132 [8] => CRM/ACL/Form/WordPress/Permissions.php:93 [9] => CRM/ACL/Form/WordPress/Permissions.php:146 [10] => CRM/Activity/Form/Task/FileOnCase.php:134 [11] => CRM/Admin/Form/PdfFormats.php:69 [12] => CRM/Admin/Form/PdfFormats.php:89 [13] => CRM/Admin/Form/RelationshipType.php:81 [14] => CRM/Admin/Form/RelationshipType.php:86 [15] => CRM/Admin/Page/ParticipantStatusType.php:95 [16] => CRM/Admin/Page/PaymentProcessor.php:109 [17] => CRM/Admin/Page/PaymentProcessor.php:118 [18] => CRM/Admin/Page/Options.php:128 [19] => CRM/Admin/Page/Options.php:213 [20] => CRM/Admin/Page/JobLog.php:86 [21] => CRM/Admin/Form/Setting/Search.php:75 [22] => CRM/Admin/Form/Setting/Search.php:87 [23] => CRM/Admin/Form/Setting.php:92 [24] => CRM/Admin/Form/Setting.php:95 [25] => CRM/Admin/Form/WordReplacements.php:58 [26] => CRM/Contact/Form/Task/EmailCommon.php:483 [27] => CRM/Contact/Form/Task/EmailCommon.php:504 [28] => CRM/Contact/Form/Task/Result.php:57 [29] => CRM/Contribute/Page/Tab.php:255 [30] => CRM/Contribute/BAO/ContributionSoft.php:116 [31] => CRM/Contact/Form/Task/Unhold.php:34 [32] => CRM/Contact/Form/Task/Unhold.php:40 [33] => CRM/Contact/Page/AJAX.php:164 [34] => CRM/Contribute/Form/Contribution/ThankYou.php:159 [35] => CRM/Contribute/Form/Contribution/ThankYou.php:245 [36] => CRM/Contribute/Form/ContributionBase.php:741 [37] => CRM/Contribute/Import/Form/MapField.php:82 [38] => CRM/Contribute/Import/Form/MapField.php:95 [39] => CRM/Contribute/Form/Task/PickProfile.php:76 [40] => CRM/Contribute/Form/Task/PickProfile.php:105 [41] => CRM/Contribute/Form/Task/PDF.php:97 [42] => CRM/Contribute/Form/ContributionPage/Custom.php:62 [43] => CRM/Contribute/Form/ContributionPage/Custom.php:72 [44] => CRM/Contribute/Form/ContributionPage/TabHeader.php:57 [45] => CRM/Contribute/Form/Task/Delete.php:89 [46] => tests/phpunit/CRM/Queue/Queue/SqlTest.php:51 [47] => CRM/Queue/ErrorPolicy.php:68 [48] => CRM/Queue/ErrorPolicy.php:87 [49] => tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php:153 [50] => tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php:159 [51] => CRM/SMS/Form/Group.php:195 [52] => CRM/SMS/Form/Group.php:256 [53] => tests/phpunit/api/v3/UtilsTest.php:192 [54] => tests/phpunit/api/v3/UtilsTest.php:258 [55] => CRM/Report/Form/Mailing/Summary.php:493 [56] => CRM/Report/Form/Mailing/Summary.php:502 [57] => tests/phpunit/Civi/API/RequestTest.php:39 [58] => tests/phpunit/Civi/API/RequestTest.php:51 [59] => CRM/Member/BAO/MembershipPayment.php:72 [60] => CRM/Member/BAO/MembershipPayment.php:82 [61] => tests/phpunit/CRM/Group/Page/AjaxTest.php:40 [62] => tests/phpunit/CRM/Group/Page/AjaxTest.php:45 [63] => CRM/Mailing/Form/ForwardMailing.php:150 [64] => CRM/Mailing/Form/ForwardMailing.php:155 [65] => CRM/Mailing/Form/Search.php:123 [66] => CRM/Mailing/Form/Search.php:131 [67] => tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php:31 [68] => tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php:36 [69] => CRM/Member/Form/MembershipType.php:238 [70] => CRM/PCP/Form/Event.php:109 [71] => CRM/PCP/Form/Event.php:125 [72] => CRM/Pledge/Form/Task/Delete.php:90 [73] => CRM/Member/Form/Task/PickProfile.php:76 [74] => CRM/Member/Form/Task/PickProfile.php:104 [75] => CRM/Member/Form/Task/Label.php:135 [76] => CRM/SMS/Form/Provider.php:102 [77] => CRM/Upgrade/Incremental/php/FourFive.php:145 ) ' echo '' echo 'Total number of edits to perform: 78' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Batch/Form/Entry.php' 205 edit_at_line 'CRM/Batch/Form/Entry.php' 256 edit_at_line 'CRM/Admin/Form/MessageTemplates.php' 147 edit_at_line 'CRM/Admin/Form/MessageTemplates.php' 191 edit_at_line 'CRM/Activity/Import/Form/MapField.php' 75 edit_at_line 'CRM/Activity/Import/Form/MapField.php' 198 edit_at_line 'CRM/Activity/Form/Task/PickProfile.php' 79 edit_at_line 'CRM/Activity/Form/Task/PickProfile.php' 132 edit_at_line 'CRM/ACL/Form/WordPress/Permissions.php' 93 edit_at_line 'CRM/ACL/Form/WordPress/Permissions.php' 146 edit_at_line 'CRM/Activity/Form/Task/FileOnCase.php' 134 edit_at_line 'CRM/Admin/Form/PdfFormats.php' 69 edit_at_line 'CRM/Admin/Form/PdfFormats.php' 89 edit_at_line 'CRM/Admin/Form/RelationshipType.php' 81 edit_at_line 'CRM/Admin/Form/RelationshipType.php' 86 edit_at_line 'CRM/Admin/Page/ParticipantStatusType.php' 95 edit_at_line 'CRM/Admin/Page/PaymentProcessor.php' 109 edit_at_line 'CRM/Admin/Page/PaymentProcessor.php' 118 edit_at_line 'CRM/Admin/Page/Options.php' 128 edit_at_line 'CRM/Admin/Page/Options.php' 213 edit_at_line 'CRM/Admin/Page/JobLog.php' 86 edit_at_line 'CRM/Admin/Form/Setting/Search.php' 75 edit_at_line 'CRM/Admin/Form/Setting/Search.php' 87 edit_at_line 'CRM/Admin/Form/Setting.php' 92 edit_at_line 'CRM/Admin/Form/Setting.php' 95 edit_at_line 'CRM/Admin/Form/WordReplacements.php' 58 edit_at_line 'CRM/Contact/Form/Task/EmailCommon.php' 483 edit_at_line 'CRM/Contact/Form/Task/EmailCommon.php' 504 edit_at_line 'CRM/Contact/Form/Task/Result.php' 57 edit_at_line 'CRM/Contribute/Page/Tab.php' 255 edit_at_line 'CRM/Contribute/BAO/ContributionSoft.php' 116 edit_at_line 'CRM/Contact/Form/Task/Unhold.php' 34 edit_at_line 'CRM/Contact/Form/Task/Unhold.php' 40 edit_at_line 'CRM/Contact/Page/AJAX.php' 164 edit_at_line 'CRM/Contribute/Form/Contribution/ThankYou.php' 159 edit_at_line 'CRM/Contribute/Form/Contribution/ThankYou.php' 245 edit_at_line 'CRM/Contribute/Form/ContributionBase.php' 741 edit_at_line 'CRM/Contribute/Import/Form/MapField.php' 82 edit_at_line 'CRM/Contribute/Import/Form/MapField.php' 95 edit_at_line 'CRM/Contribute/Form/Task/PickProfile.php' 76 edit_at_line 'CRM/Contribute/Form/Task/PickProfile.php' 105 edit_at_line 'CRM/Contribute/Form/Task/PDF.php' 97 edit_at_line 'CRM/Contribute/Form/ContributionPage/Custom.php' 62 edit_at_line 'CRM/Contribute/Form/ContributionPage/Custom.php' 72 edit_at_line 'CRM/Contribute/Form/ContributionPage/TabHeader.php' 57 edit_at_line 'CRM/Contribute/Form/Task/Delete.php' 89 edit_at_line 'tests/phpunit/CRM/Queue/Queue/SqlTest.php' 51 edit_at_line 'CRM/Queue/ErrorPolicy.php' 68 edit_at_line 'CRM/Queue/ErrorPolicy.php' 87 edit_at_line 'tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php' 153 edit_at_line 'tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php' 159 edit_at_line 'CRM/SMS/Form/Group.php' 195 edit_at_line 'CRM/SMS/Form/Group.php' 256 edit_at_line 'tests/phpunit/api/v3/UtilsTest.php' 192 edit_at_line 'tests/phpunit/api/v3/UtilsTest.php' 258 edit_at_line 'CRM/Report/Form/Mailing/Summary.php' 493 edit_at_line 'CRM/Report/Form/Mailing/Summary.php' 502 edit_at_line 'tests/phpunit/Civi/API/RequestTest.php' 39 edit_at_line 'tests/phpunit/Civi/API/RequestTest.php' 51 edit_at_line 'CRM/Member/BAO/MembershipPayment.php' 72 edit_at_line 'CRM/Member/BAO/MembershipPayment.php' 82 edit_at_line 'tests/phpunit/CRM/Group/Page/AjaxTest.php' 40 edit_at_line 'tests/phpunit/CRM/Group/Page/AjaxTest.php' 45 edit_at_line 'CRM/Mailing/Form/ForwardMailing.php' 150 edit_at_line 'CRM/Mailing/Form/ForwardMailing.php' 155 edit_at_line 'CRM/Mailing/Form/Search.php' 123 edit_at_line 'CRM/Mailing/Form/Search.php' 131 edit_at_line 'tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php' 31 edit_at_line 'tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php' 36 edit_at_line 'CRM/Member/Form/MembershipType.php' 238 edit_at_line 'CRM/PCP/Form/Event.php' 109 edit_at_line 'CRM/PCP/Form/Event.php' 125 edit_at_line 'CRM/Pledge/Form/Task/Delete.php' 90 edit_at_line 'CRM/Member/Form/Task/PickProfile.php' 76 edit_at_line 'CRM/Member/Form/Task/PickProfile.php' 104 edit_at_line 'CRM/Member/Form/Task/Label.php' 135 edit_at_line 'CRM/SMS/Form/Provider.php' 102 edit_at_line 'CRM/Upgrade/Incremental/php/FourFive.php' 145 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/Batch/BAO/Batch.php:302 [1] => CRM/Batch/BAO/Batch.php:676 [2] => CRM/Admin/Page/JobLog.php:107 [3] => CRM/Contact/Page/AJAX.php:1065 [4] => CRM/Contribute/Form/ContributionPage/TabHeader.php:174 [5] => CRM/Report/Form/Contact/LoggingSummary.php:169 [6] => CRM/Report/Form/Contact/LoggingSummary.php:176 [7] => CRM/Report/Form/Contribute/HouseholdSummary.php:284 [8] => CRM/Report/Form/Contribute/HouseholdSummary.php:455 [9] => CRM/Report/Form/Event/Summary.php:346 [10] => CRM/Member/Form/Task/PDFLetterCommon.php:24 [11] => CRM/Member/Form/Task/PDFLetterCommon.php:27 [12] => CRM/Report/Form/Pledge/Pbnp.php:332 ) ' echo '' echo 'Total number of edits to perform: 13' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Batch/BAO/Batch.php' 302 edit_at_line 'CRM/Batch/BAO/Batch.php' 676 edit_at_line 'CRM/Admin/Page/JobLog.php' 107 edit_at_line 'CRM/Contact/Page/AJAX.php' 1065 edit_at_line 'CRM/Contribute/Form/ContributionPage/TabHeader.php' 174 edit_at_line 'CRM/Report/Form/Contact/LoggingSummary.php' 169 edit_at_line 'CRM/Report/Form/Contact/LoggingSummary.php' 176 edit_at_line 'CRM/Report/Form/Contribute/HouseholdSummary.php' 284 edit_at_line 'CRM/Report/Form/Contribute/HouseholdSummary.php' 455 edit_at_line 'CRM/Report/Form/Event/Summary.php' 346 edit_at_line 'CRM/Member/Form/Task/PDFLetterCommon.php' 24 edit_at_line 'CRM/Member/Form/Task/PDFLetterCommon.php' 27 edit_at_line 'CRM/Report/Form/Pledge/Pbnp.php' 332 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"run\" [1] => Visibility must be declared on method \"filePostProcess\" [2] => Visibility must be declared on method \"formatAttachment\" [3] => Visibility must be declared on method \"formLink\" [4] => Visibility must be declared on method \"__construct\" [5] => Visibility must be declared on method \"preProcess\" [6] => Visibility must be declared on method \"browse\" [7] => Visibility must be declared on method \"createConstCookie\" [8] => Visibility must be declared on method \"getMembershipStatusByDate\" [9] => Visibility must be declared on method \"all\" ) ' echo 'Lines:Array ( [0] => CRM/Activity/Import/Parser.php:76 [1] => CRM/Core/BAO/File.php:88 [2] => CRM/Core/BAO/File.php:498 [3] => CRM/Core/Action.php:203 [4] => CRM/Core/Controller/Simple.php:57 [5] => CRM/Contact/Selector/Custom.php:120 [6] => CRM/Contact/Form/Task/SaveSearch.php:54 [7] => CRM/Contribute/Import/Parser.php:123 [8] => CRM/Contribute/Form/Task/PDF.php:56 [9] => CRM/Contribute/Form/Task/Delete.php:56 [10] => CRM/Grant/Page/Tab.php:56 [11] => tests/phpunit/CiviTest/CiviSeleniumSettings.php:17 [12] => tests/phpunit/CiviTest/CiviSeleniumSettings.php:27 [13] => CRM/Member/BAO/MembershipStatus.php:231 [14] => CRM/Pledge/Form/Task/Delete.php:56 [15] => CRM/Member/Import/Parser.php:77 [16] => CRM/Event/Import/Parser.php:77 [17] => CRM/Contact/Form/Search/Custom/EmployerListing.php:107 ) ' echo '' echo 'Total number of edits to perform: 18' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Activity/Import/Parser.php' 76 edit_at_line 'CRM/Core/BAO/File.php' 88 edit_at_line 'CRM/Core/BAO/File.php' 498 edit_at_line 'CRM/Core/Action.php' 203 edit_at_line 'CRM/Core/Controller/Simple.php' 57 edit_at_line 'CRM/Contact/Selector/Custom.php' 120 edit_at_line 'CRM/Contact/Form/Task/SaveSearch.php' 54 edit_at_line 'CRM/Contribute/Import/Parser.php' 123 edit_at_line 'CRM/Contribute/Form/Task/PDF.php' 56 edit_at_line 'CRM/Contribute/Form/Task/Delete.php' 56 edit_at_line 'CRM/Grant/Page/Tab.php' 56 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumSettings.php' 17 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumSettings.php' 27 edit_at_line 'CRM/Member/BAO/MembershipStatus.php' 231 edit_at_line 'CRM/Pledge/Form/Task/Delete.php' 56 edit_at_line 'CRM/Member/Import/Parser.php' 77 edit_at_line 'CRM/Event/Import/Parser.php' 77 edit_at_line 'CRM/Contact/Form/Search/Custom/EmployerListing.php' 107 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Activity/Import/Parser.php:281 [1] => CRM/Core/BAO/Phone.php:93 [2] => CRM/Core/Action.php:324 [3] => CRM/Core/Controller/Simple.php:46 [4] => CRM/Core/JobManager.php:57 [5] => CRM/Contact/Selector/Custom.php:377 [6] => CRM/Contribute/Import/Parser.php:410 [7] => CRM/Member/Import/Parser.php:286 [8] => CRM/Member/Form/Task/Label.php:67 [9] => CRM/Event/Import/Parser.php:296 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Activity/Import/Parser.php' 281 edit_at_line 'CRM/Core/BAO/Phone.php' 93 edit_at_line 'CRM/Core/Action.php' 324 edit_at_line 'CRM/Core/Controller/Simple.php' 46 edit_at_line 'CRM/Core/JobManager.php' 57 edit_at_line 'CRM/Contact/Selector/Custom.php' 377 edit_at_line 'CRM/Contribute/Import/Parser.php' 410 edit_at_line 'CRM/Member/Import/Parser.php' 286 edit_at_line 'CRM/Member/Form/Task/Label.php' 67 edit_at_line 'CRM/Event/Import/Parser.php' 296 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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/Activity/Form/Task/FileOnCase.php:96 [1] => CRM/Core/Permission/Soap.php:49 [2] => CRM/Contact/Page/View/UserDashBoard.php:216 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Activity/Form/Task/FileOnCase.php' 96 edit_at_line 'CRM/Core/Permission/Soap.php' 49 edit_at_line 'CRM/Contact/Page/View/UserDashBoard.php' 216 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' 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/Admin/Page/ParticipantStatusType.php:83 [1] => CRM/Core/BAO/MailSettings.php:57 [2] => CRM/Contact/Page/View/UserDashBoard.php:179 [3] => CRM/Upgrade/Incremental/php/FourFive.php:275 [4] => CRM/Report/Form/Contact/LoggingDetail.php:39 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Admin/Page/ParticipantStatusType.php' 83 edit_at_line 'CRM/Core/BAO/MailSettings.php' 57 edit_at_line 'CRM/Contact/Page/View/UserDashBoard.php' 179 edit_at_line 'CRM/Upgrade/Incremental/php/FourFive.php' 275 edit_at_line 'CRM/Report/Form/Contact/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] => sizeof() is a function name alias, use count() instead [1] => is_integer() is a function name alias, use is_int() instead ) ' echo 'Lines:Array ( [0] => CRM/Admin/Form/WordReplacements.php:222 [1] => CRM/Core/CommunityMessages.php:227 [2] => CRM/Core/CommunityMessages.php:230 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Admin/Form/WordReplacements.php' 222 edit_at_line 'CRM/Core/CommunityMessages.php' 227 edit_at_line 'CRM/Core/CommunityMessages.php' 230 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' 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/Contact/Form/Task/Result.php:97 [1] => CRM/Core/Permission/WordPress.php:105 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Form/Task/Result.php' 97 edit_at_line 'CRM/Core/Permission/WordPress.php' 105 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' 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|void\" but found \"number|void\" for function return type [2] => Expected \"string\" but found \"String\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/Note.php:81 [1] => CRM/Core/BAO/Note.php:226 [2] => CRM/Core/BAO/MailSettings.php:99 [3] => CRM/Core/BAO/Discount.php:50 [4] => CRM/Core/Component/Info.php:232 [5] => CRM/Core/Component/Info.php:325 [6] => CRM/Core/Permission/Soap.php:47 [7] => CRM/Core/Permission/WordPress.php:46 [8] => CRM/Core/Permission/Joomla.php:46 [9] => CRM/Core/Permission/Joomla.php:107 [10] => CRM/Core/Permission/Drupal.php:73 [11] => CRM/Core/Permission/Drupal.php:99 [12] => CRM/Price/BAO/LineItem.php:538 [13] => CRM/Core/BAO/OptionGroup.php:137 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Note.php' 81 edit_at_line 'CRM/Core/BAO/Note.php' 226 edit_at_line 'CRM/Core/BAO/MailSettings.php' 99 edit_at_line 'CRM/Core/BAO/Discount.php' 50 edit_at_line 'CRM/Core/Component/Info.php' 232 edit_at_line 'CRM/Core/Component/Info.php' 325 edit_at_line 'CRM/Core/Permission/Soap.php' 47 edit_at_line 'CRM/Core/Permission/WordPress.php' 46 edit_at_line 'CRM/Core/Permission/Joomla.php' 46 edit_at_line 'CRM/Core/Permission/Joomla.php' 107 edit_at_line 'CRM/Core/Permission/Drupal.php' 73 edit_at_line 'CRM/Core/Permission/Drupal.php' 99 edit_at_line 'CRM/Price/BAO/LineItem.php' 538 edit_at_line 'CRM/Core/BAO/OptionGroup.php' 137 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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/Phone.php:144 [1] => CRM/Contact/Form/Task/SaveSearch.php:97 [2] => CRM/Member/Form/MembershipType.php:85 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Phone.php' 144 edit_at_line 'CRM/Contact/Form/Task/SaveSearch.php' 97 edit_at_line 'CRM/Member/Form/MembershipType.php' 85 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $entityIdEntity does not match actual variable name $entityTable [1] => Doc comment for parameter $filter does not match actual variable name $isTest [2] => Doc comment for parameter $excludeIsAdminExclude does not match actual variable name $membership ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/Discount.php:86 [1] => CRM/Contribute/BAO/ContributionSoft.php:241 [2] => CRM/Member/BAO/MembershipStatus.php:223 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Discount.php' 86 edit_at_line 'CRM/Contribute/BAO/ContributionSoft.php' 241 edit_at_line 'CRM/Member/BAO/MembershipStatus.php' 223 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidNoReturn' echo 'Messages:Array ( [0] => @return doc comment specified, but function has no return statement ) ' echo 'Lines:Array ( [0] => CRM/Core/JobManager.php:204 [1] => CRM/Contribute/Page/UserDashboard.php:40 [2] => CRM/Contribute/Page/UserDashboard.php:149 [3] => CRM/Contribute/Page/Tab.php:107 [4] => CRM/Contact/Page/View/Note.php:85 [5] => CRM/Contact/Page/View/Note.php:164 [6] => CRM/Grant/Page/Tab.php:54 [7] => CRM/Pledge/Page/UserDashboard.php:40 [8] => CRM/Pledge/Page/UserDashboard.php:75 ) ' echo '' echo 'Total number of edits to perform: 9' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/JobManager.php' 204 edit_at_line 'CRM/Contribute/Page/UserDashboard.php' 40 edit_at_line 'CRM/Contribute/Page/UserDashboard.php' 149 edit_at_line 'CRM/Contribute/Page/Tab.php' 107 edit_at_line 'CRM/Contact/Page/View/Note.php' 85 edit_at_line 'CRM/Contact/Page/View/Note.php' 164 edit_at_line 'CRM/Grant/Page/Tab.php' 54 edit_at_line 'CRM/Pledge/Page/UserDashboard.php' 40 edit_at_line 'CRM/Pledge/Page/UserDashboard.php' 75 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Core/Payment/AuthorizeNet.php:399 [1] => CRM/Core/Payment/AuthorizeNet.php:462 [2] => CRM/Contribute/Form/ContributionBase.php:890 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/AuthorizeNet.php' 399 edit_at_line 'CRM/Core/Payment/AuthorizeNet.php' 462 edit_at_line 'CRM/Contribute/Form/ContributionBase.php' 890 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/CRM/Queue/Queue/SqlTest.php:57 [1] => CRM/Report/Form/Event/Summary.php:246 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Queue/Queue/SqlTest.php' 57 edit_at_line 'CRM/Report/Form/Event/Summary.php' 246 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' 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 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Case/TimeSpent.php:102 [1] => CRM/Report/Form/Case/TimeSpent.php:104 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Case/TimeSpent.php' 102 edit_at_line 'CRM/Report/Form/Case/TimeSpent.php' 104 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' 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/Queue/Task.php:33 [1] => CRM/Queue/Task.php:36 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Queue/Task.php' 33 edit_at_line 'CRM/Queue/Task.php' 36 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.ContentAfterOpen!' 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/BAO/LineItem.php:544 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Price/BAO/LineItem.php' 544 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' 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/SMS/Form/Provider.php:156 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/SMS/Form/Provider.php' 156 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.IncorrectTypeHint' echo 'Messages:Array ( [0] => Expected type hint \"CaseChangeEvent\"; found \"\Civi\CCase\Event\CaseChangeEvent\" for $event ) ' echo 'Lines:Array ( [0] => Civi/CCase/Events.php:92 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'Civi/CCase/Events.php' 92 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.IncorrectTypeHint!' 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/MembershipPayment.php:46 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/MembershipPayment.php' 46 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi