#!/bin/bash ## usage: bash batch-14.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.InvalidNoReturn' echo 'Messages:Array ( [0] => @return doc comment specified, but function has no return statement ) ' echo 'Lines:Array ( [0] => CRM/Contact/Page/View/UserDashBoard/GroupContact.php:40 [1] => CRM/Contact/Page/View/UserDashBoard/GroupContact.php:135 [2] => api/v3/Contribution.php:341 [3] => api/v3/Contribution.php:397 [4] => CRM/Activity/Page/UserDashboard.php:71 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Page/View/UserDashBoard/GroupContact.php' 40 edit_at_line 'CRM/Contact/Page/View/UserDashBoard/GroupContact.php' 135 edit_at_line 'api/v3/Contribution.php' 341 edit_at_line 'api/v3/Contribution.php' 397 edit_at_line 'CRM/Activity/Page/UserDashboard.php' 71 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Contact/Page/View/UserDashBoard/GroupContact.php:87 [1] => CRM/Price/BAO/PriceFieldValue.php:83 [2] => CRM/Core/Payment/Form.php:268 [3] => CRM/Activity/Page/UserDashboard.php:64 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Page/View/UserDashBoard/GroupContact.php' 87 edit_at_line 'CRM/Price/BAO/PriceFieldValue.php' 83 edit_at_line 'CRM/Core/Payment/Form.php' 268 edit_at_line 'CRM/Activity/Page/UserDashboard.php' 64 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/Contact/Page/View/UserDashBoard/GroupContact.php:96 [1] => CRM/Contact/Page/View/UserDashBoard/GroupContact.php:98 [2] => CRM/Mailing/Form/Group.php:227 [3] => CRM/Campaign/Form/Survey/Questions.php:60 [4] => CRM/Activity/Page/AJAX.php:296 [5] => CRM/Activity/Page/AJAX.php:306 [6] => CRM/Activity/Page/UserDashboard.php:48 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Page/View/UserDashBoard/GroupContact.php' 96 edit_at_line 'CRM/Contact/Page/View/UserDashBoard/GroupContact.php' 98 edit_at_line 'CRM/Mailing/Form/Group.php' 227 edit_at_line 'CRM/Campaign/Form/Survey/Questions.php' 60 edit_at_line 'CRM/Activity/Page/AJAX.php' 296 edit_at_line 'CRM/Activity/Page/AJAX.php' 306 edit_at_line 'CRM/Activity/Page/UserDashboard.php' 48 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' 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: _id [1] => A comma should follow the last multiline array item. Found: '\''html'\'' [2] => A comma should follow the last multiline array item. Found: $desc [3] => A comma should follow the last multiline array item. Found: $type [4] => A comma should follow the last multiline array item. Found: $name [5] => A comma should follow the last multiline array item. Found: 0 [6] => A comma should follow the last multiline array item. Found: '\''access all cases and activities'\'' [7] => A comma should follow the last multiline array item. Found: lcMessages [8] => A comma should follow the last multiline array item. Found: $html [9] => A comma should follow the last multiline array item. Found: '\''CRM/Contact/Page/View'\'' [10] => A comma should follow the last multiline array item. Found: '\''replacePermission'\'' [11] => A comma should follow the last multiline array item. Found: \"http://book.civicrm.org/user/advanced-configuration/email-system-configuration/\" [12] => A comma should follow the last multiline array item. Found: ) [13] => A comma should follow the last multiline array item. Found: '\''email_selection_method'\'' [14] => A comma should follow the last multiline array item. Found: '\''- select -'\'' [15] => A comma should follow the last multiline array item. Found: '\''footer'\'' [16] => A comma should follow the last multiline array item. Found: 1 [17] => A comma should follow the last multiline array item. Found: '\''N'\'' [18] => A comma should follow the last multiline array item. Found: '\''Y'\'' [19] => A comma should follow the last multiline array item. Found: '\''interview'\'' [20] => A comma should follow the last multiline array item. Found: '\''redactionRegexRules'\'' [21] => A comma should follow the last multiline array item. Found: '\''Inbound Email'\'' [22] => A comma should follow the last multiline array item. Found: _eventID [23] => A comma should follow the last multiline array item. Found: _contactID [24] => A comma should follow the last multiline array item. Found: '\''Integer'\'' [25] => A comma should follow the last multiline array item. Found: TRUE [26] => A comma should follow the last multiline array item. Found: FALSE [27] => A comma should follow the last multiline array item. Found: '\''precinct'\'' [28] => A comma should follow the last multiline array item. Found: '\''past_campaign'\'' [29] => A comma should follow the last multiline array item. Found: '\''new'\'' [30] => A comma should follow the last multiline array item. Found: '\''class'\'' [31] => A comma should follow the last multiline array item. Found: '\''file'\'' [32] => A comma should follow the last multiline array item. Found: $userName [33] => A comma should follow the last multiline array item. Found: '\''endDate'\'' [34] => A comma should follow the last multiline array item. Found: '\'''\'' [35] => A comma should follow the last multiline array item. Found: \"Texas\" ) ' echo 'Lines:Array ( [0] => CRM/Mailing/Form/Component.php:74 [1] => CRM/Mailing/Form/Component.php:174 [2] => CRM/Mailing/Form/Component.php:182 [3] => CRM/Mailing/Form/Component.php:189 [4] => CRM/SMS/Form/Upload.php:418 [5] => CRM/Core/BAO/Dashboard.php:162 [6] => CRM/Core/BAO/Dashboard.php:229 [7] => CRM/Upgrade/Incremental/Legacy.php:86 [8] => CRM/Upgrade/Incremental/Legacy.php:206 [9] => CRM/Upgrade/Incremental/Legacy.php:253 [10] => CRM/Upgrade/Incremental/Legacy.php:553 [11] => CRM/Mailing/Form/Group.php:58 [12] => CRM/Mailing/Form/Group.php:246 [13] => CRM/Mailing/Form/Group.php:395 [14] => CRM/Mailing/Form/Upload.php:234 [15] => CRM/Mailing/Form/Upload.php:561 [16] => CRM/Mailing/Form/Upload.php:601 [17] => CRM/Mailing/Form/Upload.php:670 [18] => tests/phpunit/CRM/Contact/BAO/QueryTest.php:78 [19] => tests/phpunit/CRM/Contact/BAO/QueryTest.php:120 [20] => tests/phpunit/CRM/Contact/BAO/QueryTest.php:163 [21] => CRM/Core/Payment/Form.php:162 [22] => CRM/Campaign/Form/Survey/Main.php:232 [23] => tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php:35 [24] => tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php:44 [25] => tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php:69 [26] => tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php:78 [27] => CRM/Campaign/Form/Search.php:99 [28] => CRM/Campaign/Form/Search.php:235 [29] => CRM/Campaign/Form/Search.php:359 [30] => CRM/Case/XMLProcessor/Report.php:71 [31] => CRM/Case/XMLProcessor/Report.php:326 [32] => CRM/Case/XMLProcessor/Report.php:640 [33] => tests/phpunit/api/v3/ParticipantTest.php:67 [34] => tests/phpunit/api/v3/ParticipantTest.php:72 [35] => tests/phpunit/api/v3/ParticipantTest.php:76 [36] => tests/phpunit/api/v3/ParticipantTest.php:193 [37] => tests/phpunit/api/v3/ParticipantPaymentTest.php:58 [38] => tests/phpunit/api/v3/ParticipantPaymentTest.php:63 [39] => tests/phpunit/api/v3/ParticipantPaymentTest.php:67 [40] => tests/phpunit/api/v3/ParticipantPaymentTest.php:73 [41] => CRM/Event/BAO/ParticipantPayment.php:79 [42] => CRM/Event/BAO/ParticipantPayment.php:80 [43] => CRM/Event/BAO/ParticipantPayment.php:88 [44] => tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php:37 [45] => tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php:46 [46] => tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php:55 [47] => tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php:64 [48] => CRM/Campaign/BAO/Query.php:409 [49] => CRM/Campaign/BAO/Query.php:589 [50] => CRM/Mailing/MailStore/Maildir.php:59 [51] => CRM/Mailing/MailStore/Maildir.php:65 [52] => CRM/Mailing/MailStore/Maildir.php:87 [53] => CRM/Activity/Page/AJAX.php:80 [54] => CRM/Activity/Page/AJAX.php:378 [55] => CRM/Member/Form/Membership.php:474 [56] => CRM/Member/Form/Membership.php:1223 [57] => CRM/Core/SelectValues.php:978 [58] => tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php:143 [59] => tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php:302 [60] => tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php:454 [61] => tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php:608 [62] => tests/phpunit/WebTest/Contact/AdvancedSearchTest.php:136 [63] => tests/phpunit/WebTest/Contact/AdvancedSearchTest.php:251 ) ' echo '' echo 'Total number of edits to perform: 64' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Mailing/Form/Component.php' 74 edit_at_line 'CRM/Mailing/Form/Component.php' 174 edit_at_line 'CRM/Mailing/Form/Component.php' 182 edit_at_line 'CRM/Mailing/Form/Component.php' 189 edit_at_line 'CRM/SMS/Form/Upload.php' 418 edit_at_line 'CRM/Core/BAO/Dashboard.php' 162 edit_at_line 'CRM/Core/BAO/Dashboard.php' 229 edit_at_line 'CRM/Upgrade/Incremental/Legacy.php' 86 edit_at_line 'CRM/Upgrade/Incremental/Legacy.php' 206 edit_at_line 'CRM/Upgrade/Incremental/Legacy.php' 253 edit_at_line 'CRM/Upgrade/Incremental/Legacy.php' 553 edit_at_line 'CRM/Mailing/Form/Group.php' 58 edit_at_line 'CRM/Mailing/Form/Group.php' 246 edit_at_line 'CRM/Mailing/Form/Group.php' 395 edit_at_line 'CRM/Mailing/Form/Upload.php' 234 edit_at_line 'CRM/Mailing/Form/Upload.php' 561 edit_at_line 'CRM/Mailing/Form/Upload.php' 601 edit_at_line 'CRM/Mailing/Form/Upload.php' 670 edit_at_line 'tests/phpunit/CRM/Contact/BAO/QueryTest.php' 78 edit_at_line 'tests/phpunit/CRM/Contact/BAO/QueryTest.php' 120 edit_at_line 'tests/phpunit/CRM/Contact/BAO/QueryTest.php' 163 edit_at_line 'CRM/Core/Payment/Form.php' 162 edit_at_line 'CRM/Campaign/Form/Survey/Main.php' 232 edit_at_line 'tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php' 35 edit_at_line 'tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php' 44 edit_at_line 'tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php' 69 edit_at_line 'tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php' 78 edit_at_line 'CRM/Campaign/Form/Search.php' 99 edit_at_line 'CRM/Campaign/Form/Search.php' 235 edit_at_line 'CRM/Campaign/Form/Search.php' 359 edit_at_line 'CRM/Case/XMLProcessor/Report.php' 71 edit_at_line 'CRM/Case/XMLProcessor/Report.php' 326 edit_at_line 'CRM/Case/XMLProcessor/Report.php' 640 edit_at_line 'tests/phpunit/api/v3/ParticipantTest.php' 67 edit_at_line 'tests/phpunit/api/v3/ParticipantTest.php' 72 edit_at_line 'tests/phpunit/api/v3/ParticipantTest.php' 76 edit_at_line 'tests/phpunit/api/v3/ParticipantTest.php' 193 edit_at_line 'tests/phpunit/api/v3/ParticipantPaymentTest.php' 58 edit_at_line 'tests/phpunit/api/v3/ParticipantPaymentTest.php' 63 edit_at_line 'tests/phpunit/api/v3/ParticipantPaymentTest.php' 67 edit_at_line 'tests/phpunit/api/v3/ParticipantPaymentTest.php' 73 edit_at_line 'CRM/Event/BAO/ParticipantPayment.php' 79 edit_at_line 'CRM/Event/BAO/ParticipantPayment.php' 80 edit_at_line 'CRM/Event/BAO/ParticipantPayment.php' 88 edit_at_line 'tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php' 37 edit_at_line 'tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php' 46 edit_at_line 'tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php' 55 edit_at_line 'tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php' 64 edit_at_line 'CRM/Campaign/BAO/Query.php' 409 edit_at_line 'CRM/Campaign/BAO/Query.php' 589 edit_at_line 'CRM/Mailing/MailStore/Maildir.php' 59 edit_at_line 'CRM/Mailing/MailStore/Maildir.php' 65 edit_at_line 'CRM/Mailing/MailStore/Maildir.php' 87 edit_at_line 'CRM/Activity/Page/AJAX.php' 80 edit_at_line 'CRM/Activity/Page/AJAX.php' 378 edit_at_line 'CRM/Member/Form/Membership.php' 474 edit_at_line 'CRM/Member/Form/Membership.php' 1223 edit_at_line 'CRM/Core/SelectValues.php' 978 edit_at_line 'tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php' 143 edit_at_line 'tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php' 302 edit_at_line 'tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php' 454 edit_at_line 'tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php' 608 edit_at_line 'tests/phpunit/WebTest/Contact/AdvancedSearchTest.php' 136 edit_at_line 'tests/phpunit/WebTest/Contact/AdvancedSearchTest.php' 251 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/SMS/Form/Upload.php:311 [1] => CRM/SMS/Form/Upload.php:339 [2] => CRM/SMS/Form/Upload.php:384 [3] => CRM/Core/BAO/IM.php:140 [4] => CRM/Core/BAO/IM.php:144 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/SMS/Form/Upload.php' 311 edit_at_line 'CRM/SMS/Form/Upload.php' 339 edit_at_line 'CRM/SMS/Form/Upload.php' 384 edit_at_line 'CRM/Core/BAO/IM.php' 140 edit_at_line 'CRM/Core/BAO/IM.php' 144 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' 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/Core/BAO/Dashboard.php:201 [1] => CRM/Core/BAO/IM.php:68 [2] => CRM/Utils/System/WordPress.php:670 [3] => CRM/Utils/System/Drupal.php:818 [4] => CRM/Contribute/Import/Parser/Contribution.php:143 [5] => CRM/Contribute/Import/Parser/Contribution.php:155 [6] => CRM/Contribute/Import/Parser/Contribution.php:168 [7] => CRM/Contribute/Import/Parser/Contribution.php:247 [8] => CRM/Event/Import/Parser/Participant.php:131 [9] => CRM/Event/Import/Parser/Participant.php:143 [10] => CRM/Event/Import/Parser/Participant.php:156 [11] => CRM/Event/Import/Parser/Participant.php:275 [12] => CRM/Utils/Rule.php:627 [13] => CRM/Utils/System/Drupal6.php:766 [14] => CRM/Price/BAO/PriceFieldValue.php:224 [15] => CRM/Event/BAO/ParticipantPayment.php:102 [16] => api/v3/Contribution.php:176 [17] => CRM/Member/Form/Membership.php:1725 [18] => CRM/Activity/Import/Parser/Activity.php:138 [19] => CRM/Activity/Import/Parser/Activity.php:150 [20] => CRM/Activity/Import/Parser/Activity.php:163 [21] => CRM/Activity/Import/Parser/Activity.php:248 [22] => CRM/Contribute/BAO/ContributionRecur.php:114 [23] => CRM/SMS/Form/Schedule.php:124 ) ' echo '' echo 'Total number of edits to perform: 24' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Dashboard.php' 201 edit_at_line 'CRM/Core/BAO/IM.php' 68 edit_at_line 'CRM/Utils/System/WordPress.php' 670 edit_at_line 'CRM/Utils/System/Drupal.php' 818 edit_at_line 'CRM/Contribute/Import/Parser/Contribution.php' 143 edit_at_line 'CRM/Contribute/Import/Parser/Contribution.php' 155 edit_at_line 'CRM/Contribute/Import/Parser/Contribution.php' 168 edit_at_line 'CRM/Contribute/Import/Parser/Contribution.php' 247 edit_at_line 'CRM/Event/Import/Parser/Participant.php' 131 edit_at_line 'CRM/Event/Import/Parser/Participant.php' 143 edit_at_line 'CRM/Event/Import/Parser/Participant.php' 156 edit_at_line 'CRM/Event/Import/Parser/Participant.php' 275 edit_at_line 'CRM/Utils/Rule.php' 627 edit_at_line 'CRM/Utils/System/Drupal6.php' 766 edit_at_line 'CRM/Price/BAO/PriceFieldValue.php' 224 edit_at_line 'CRM/Event/BAO/ParticipantPayment.php' 102 edit_at_line 'api/v3/Contribution.php' 176 edit_at_line 'CRM/Member/Form/Membership.php' 1725 edit_at_line 'CRM/Activity/Import/Parser/Activity.php' 138 edit_at_line 'CRM/Activity/Import/Parser/Activity.php' 150 edit_at_line 'CRM/Activity/Import/Parser/Activity.php' 163 edit_at_line 'CRM/Activity/Import/Parser/Activity.php' 248 edit_at_line 'CRM/Contribute/BAO/ContributionRecur.php' 114 edit_at_line 'CRM/SMS/Form/Schedule.php' 124 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => is_integer() is a function name alias, use is_int() instead [1] => sizeof() is a function name alias, use count() instead ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/Dashboard.php:368 [1] => tests/phpunit/CRM/Activity/BAO/ActivityTest.php:413 [2] => tests/phpunit/CRM/Activity/BAO/ActivityTest.php:449 [3] => tests/phpunit/CRM/Activity/BAO/ActivityTest.php:492 [4] => tests/phpunit/CRM/Activity/BAO/ActivityTest.php:545 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Dashboard.php' 368 edit_at_line 'tests/phpunit/CRM/Activity/BAO/ActivityTest.php' 413 edit_at_line 'tests/phpunit/CRM/Activity/BAO/ActivityTest.php' 449 edit_at_line 'tests/phpunit/CRM/Activity/BAO/ActivityTest.php' 492 edit_at_line 'tests/phpunit/CRM/Activity/BAO/ActivityTest.php' 545 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' 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/Core/BAO/IM.php:66 [1] => CRM/Utils/System/WordPress.php:240 [2] => CRM/Core/Smarty/plugins/modifier.mb_truncate.php:53 [3] => CRM/Core/Smarty/plugins/modifier.mb_truncate.php:54 [4] => CRM/Core/Smarty/plugins/modifier.mb_truncate.php:55 [5] => CRM/Core/Smarty/plugins/modifier.mb_truncate.php:56 [6] => CRM/Utils/System/Drupal.php:419 [7] => CRM/Utils/System/Drupal.php:564 [8] => CRM/Core/BAO/PdfFormat.php:100 [9] => CRM/Core/BAO/PdfFormat.php:115 [10] => CRM/Core/BAO/PdfFormat.php:132 [11] => CRM/Core/BAO/PdfFormat.php:194 [12] => CRM/Utils/System/Drupal6.php:405 [13] => CRM/Utils/System/Drupal6.php:518 [14] => CRM/Campaign/Form/Survey/Questions.php:46 [15] => CRM/Campaign/Form/Survey/Questions.php:70 [16] => CRM/Campaign/Form/Survey/Questions.php:110 [17] => CRM/Campaign/Form/Survey/Main.php:107 [18] => CRM/Campaign/Form/Survey/Main.php:146 [19] => CRM/Campaign/Form/Survey/Main.php:193 [20] => CRM/Utils/SQL/Select.php:181 ) ' echo '' echo 'Total number of edits to perform: 21' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/IM.php' 66 edit_at_line 'CRM/Utils/System/WordPress.php' 240 edit_at_line 'CRM/Core/Smarty/plugins/modifier.mb_truncate.php' 53 edit_at_line 'CRM/Core/Smarty/plugins/modifier.mb_truncate.php' 54 edit_at_line 'CRM/Core/Smarty/plugins/modifier.mb_truncate.php' 55 edit_at_line 'CRM/Core/Smarty/plugins/modifier.mb_truncate.php' 56 edit_at_line 'CRM/Utils/System/Drupal.php' 419 edit_at_line 'CRM/Utils/System/Drupal.php' 564 edit_at_line 'CRM/Core/BAO/PdfFormat.php' 100 edit_at_line 'CRM/Core/BAO/PdfFormat.php' 115 edit_at_line 'CRM/Core/BAO/PdfFormat.php' 132 edit_at_line 'CRM/Core/BAO/PdfFormat.php' 194 edit_at_line 'CRM/Utils/System/Drupal6.php' 405 edit_at_line 'CRM/Utils/System/Drupal6.php' 518 edit_at_line 'CRM/Campaign/Form/Survey/Questions.php' 46 edit_at_line 'CRM/Campaign/Form/Survey/Questions.php' 70 edit_at_line 'CRM/Campaign/Form/Survey/Questions.php' 110 edit_at_line 'CRM/Campaign/Form/Survey/Main.php' 107 edit_at_line 'CRM/Campaign/Form/Survey/Main.php' 146 edit_at_line 'CRM/Campaign/Form/Survey/Main.php' 193 edit_at_line 'CRM/Utils/SQL/Select.php' 181 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"url\" [1] => Visibility must be declared on method \"__construct\" [2] => Visibility must be declared on method \"initialize\" [3] => Visibility must be declared on method \"run\" [4] => Visibility must be declared on method \"preProcess\" [5] => Visibility must be declared on method \"caseInfo\" [6] => Visibility must be declared on method \"defaultReturnProperties\" [7] => Visibility must be declared on method \"_getPremiumActualCost\" [8] => Visibility must be declared on method \"_getFinancialTrxnAmount\" [9] => Visibility must be declared on method \"_getFinancialItemAmount\" [10] => Visibility must be declared on method \"_getTotalContributedAmount\" [11] => Visibility must be declared on method \"indices\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/System/WordPress.php:289 [1] => bin/deprecated/CiviReportMail.php:35 [2] => bin/deprecated/CiviReportMail.php:44 [3] => bin/deprecated/CiviReportMail.php:51 [4] => CRM/Campaign/Form/Search.php:77 [5] => CRM/Case/XMLProcessor/Report.php:99 [6] => CRM/Campaign/BAO/Query.php:270 [7] => tests/phpunit/WebTest/Contribute/UpdateContributionTest.php:378 [8] => tests/phpunit/WebTest/Contribute/UpdateContributionTest.php:408 [9] => tests/phpunit/WebTest/Contribute/UpdateContributionTest.php:424 [10] => tests/phpunit/WebTest/Contribute/UpdateContributionTest.php:440 [11] => CRM/Core/I18n/SchemaStructure_2_2_0.php:50 ) ' echo '' echo 'Total number of edits to perform: 12' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/WordPress.php' 289 edit_at_line 'bin/deprecated/CiviReportMail.php' 35 edit_at_line 'bin/deprecated/CiviReportMail.php' 44 edit_at_line 'bin/deprecated/CiviReportMail.php' 51 edit_at_line 'CRM/Campaign/Form/Search.php' 77 edit_at_line 'CRM/Case/XMLProcessor/Report.php' 99 edit_at_line 'CRM/Campaign/BAO/Query.php' 270 edit_at_line 'tests/phpunit/WebTest/Contribute/UpdateContributionTest.php' 378 edit_at_line 'tests/phpunit/WebTest/Contribute/UpdateContributionTest.php' 408 edit_at_line 'tests/phpunit/WebTest/Contribute/UpdateContributionTest.php' 424 edit_at_line 'tests/phpunit/WebTest/Contribute/UpdateContributionTest.php' 440 edit_at_line 'CRM/Core/I18n/SchemaStructure_2_2_0.php' 50 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' 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/Utils/System/WordPress.php:758 [1] => CRM/Activity/Page/UserDashboard.php:64 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/WordPress.php' 758 edit_at_line 'CRM/Activity/Page/UserDashboard.php' 64 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' 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 2 spaces [1] => Return comment indentation must be 3 spaces, found 1 spaces ) ' echo 'Lines:Array ( [0] => CRM/Utils/System/Drupal.php:460 [1] => api/v3/Activity.php:225 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/Drupal.php' 460 edit_at_line 'api/v3/Activity.php' 225 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $_FILES) does not match actual variable name $elementValue [1] => Doc comment for parameter $entityTableEntity does not match actual variable name $financialTypeID [2] => Doc comment for parameter $financialTypeIDFinancial does not match actual variable name $financialTypeID ) ' echo 'Lines:Array ( [0] => CRM/Utils/Rule.php:558 [1] => CRM/Utils/Rule.php:575 [2] => CRM/Utils/Rule.php:605 [3] => CRM/Price/BAO/PriceFieldValue.php:243 [4] => CRM/Price/BAO/PriceFieldValue.php:245 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Rule.php' 558 edit_at_line 'CRM/Utils/Rule.php' 575 edit_at_line 'CRM/Utils/Rule.php' 605 edit_at_line 'CRM/Price/BAO/PriceFieldValue.php' 243 edit_at_line 'CRM/Price/BAO/PriceFieldValue.php' 245 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace' echo 'Messages:Array ( [0] => There should be no white space after an opening \"{\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/System/Drupal6.php:476 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/Drupal6.php' 476 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace!' 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] => bin/deprecated/CiviReportMail.php:75 [1] => tests/phpunit/CRM/Contact/BAO/QueryTest.php:14 [2] => CRM/Mailing/MailStore/Maildir.php:81 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'bin/deprecated/CiviReportMail.php' 75 edit_at_line 'tests/phpunit/CRM/Contact/BAO/QueryTest.php' 14 edit_at_line 'CRM/Mailing/MailStore/Maildir.php' 81 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 6 spaces but found 8 [1] => Array indentation error, expected 6 spaces but found 0 [2] => Array indentation error, expected 12 spaces but found 14 ) ' echo 'Lines:Array ( [0] => CRM/Core/Payment/Form.php:163 [1] => CRM/Core/Payment/Form.php:164 [2] => tests/phpunit/api/v3/ReportTemplateTest.php:177 [3] => tests/phpunit/api/v3/ReportTemplateTest.php:178 [4] => tests/phpunit/api/v3/ReportTemplateTest.php:179 [5] => tests/phpunit/api/v3/ReportTemplateTest.php:183 [6] => CRM/Member/Form/Membership.php:579 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/Form.php' 163 edit_at_line 'CRM/Core/Payment/Form.php' 164 edit_at_line 'tests/phpunit/api/v3/ReportTemplateTest.php' 177 edit_at_line 'tests/phpunit/api/v3/ReportTemplateTest.php' 178 edit_at_line 'tests/phpunit/api/v3/ReportTemplateTest.php' 179 edit_at_line 'tests/phpunit/api/v3/ReportTemplateTest.php' 183 edit_at_line 'CRM/Member/Form/Membership.php' 579 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' 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/Contribution.php:347 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Contribution.php' 347 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.SpaceUnaryOperator.BooleanNot!' 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/BAO/Query.php:574 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/BAO/Query.php' 574 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.WhiteSpace.SuperfluousWhitespace.EndLine' echo 'Messages:Array ( [0] => Whitespace found at end of line ) ' echo 'Lines:Array ( [0] => CRM/Core/SelectValues.php:42 [1] => CRM/Core/SelectValues.php:84 [2] => CRM/Core/SelectValues.php:765 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/SelectValues.php' 42 edit_at_line 'CRM/Core/SelectValues.php' 84 edit_at_line 'CRM/Core/SelectValues.php' 765 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EndLine!' 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/WebTest/Contact/AdvancedSearchTest.php:177 [1] => tests/phpunit/WebTest/Contact/AdvancedSearchTest.php:235 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/WebTest/Contact/AdvancedSearchTest.php' 177 edit_at_line 'tests/phpunit/WebTest/Contact/AdvancedSearchTest.php' 235 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' echo '' echo 'Yay!' echo '' fi