#!/bin/bash ## usage: bash batch-7.sh.txt #[ -n "$1" ] && EDITOR="$1" #if [ -z "$EDITOR" ]; then # echo "Please provide parameter 1 (editor). Example: vi, joe" # exit 1 #fi function edit_at_line() { local f="$1" local l="$2" $EDITOR +$l "$f" } function ask_continue() { local line="" while [ "$line" != "y" -a "$line" != "n" ]; do echo -n "$1 (Y/n) " read line if [ -z "$line" ]; then line=y fi done if [ "$line" == "y" ]; then return 0 else return 1 fi } echo 'Welcome and thanks for helping with the cleanup!' echo '' echo 'This script will walk through a series of code-style issues in Civi'\''s PHP code.' echo 'For each issue, it will show a summary of the issue (ie how many files are' echo 'affected, how many lines of code are affected, and what detailed messages' echo 'are available about the issues.' echo '' echo 'The script will open the first file at the offending line so that you can fix' echo 'it. Please save, edit, close. The script will then repeat -- re-opening the text' echo 'editor at each offending line.' echo '' echo 'The script should generally open on the exact line with the problem; however,' echo 'if other changes were recently made to the file, then the line numbers may be' echo 'slightly off - if you don'\''t see a problem, then check the neighboring lines.' ask_continue 'Continue?' || exit echo '' echo 'What text editor would you prefer to use? [vi, emacs, joe]?' read EDITOR echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/CustomField.php:66 [1] => CRM/Core/BAO/MessageTemplate.php:277 [2] => CRM/Member/BAO/MembershipType.php:606 [3] => CRM/Member/BAO/MembershipType.php:758 [4] => CRM/Member/BAO/MembershipType.php:760 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomField.php' 66 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 277 edit_at_line 'CRM/Member/BAO/MembershipType.php' 606 edit_at_line 'CRM/Member/BAO/MembershipType.php' 758 edit_at_line 'CRM/Member/BAO/MembershipType.php' 760 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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] => CRM/Core/BAO/CustomField.php:704 [1] => CRM/Core/BAO/CustomField.php:1929 [2] => CRM/Core/BAO/UFField.php:572 [3] => CRM/Core/BAO/UFField.php:596 [4] => CRM/Contact/BAO/GroupContact.php:336 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomField.php' 704 edit_at_line 'CRM/Core/BAO/CustomField.php' 1929 edit_at_line 'CRM/Core/BAO/UFField.php' 572 edit_at_line 'CRM/Core/BAO/UFField.php' 596 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 336 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for function return type [1] => Expected \"array|bool\" but found \"Array|bool\" for function return type [2] => Expected \"array\" but found \"Array\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/CustomField.php:1087 [1] => CRM/Contact/BAO/GroupContactCache.php:46 [2] => CRM/Contact/BAO/GroupContactCache.php:125 [3] => CRM/Core/BAO/UFField.php:109 [4] => CRM/Core/BAO/UFField.php:363 [5] => CRM/Core/BAO/UFField.php:453 [6] => CRM/Core/BAO/UFField.php:731 [7] => CRM/Contact/BAO/Individual.php:413 [8] => CRM/Contact/BAO/GroupContact.php:76 [9] => CRM/Contact/BAO/GroupContact.php:804 [10] => CRM/Core/BAO/ConfigSetting.php:659 [11] => CRM/Member/BAO/Membership.php:449 [12] => CRM/Member/BAO/Membership.php:1925 [13] => CRM/Member/BAO/Membership.php:2035 [14] => CRM/Member/BAO/MembershipType.php:481 [15] => CRM/Member/BAO/MembershipType.php:588 [16] => CRM/Member/BAO/MembershipType.php:608 [17] => CRM/Event/Form/Registration/AdditionalParticipant.php:766 [18] => CRM/Contact/BAO/Relationship.php:375 [19] => CRM/Contact/BAO/Relationship.php:671 [20] => CRM/Contact/BAO/Relationship.php:742 [21] => CRM/Core/BAO/Email.php:120 ) ' echo '' echo 'Total number of edits to perform: 22' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomField.php' 1087 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 46 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 125 edit_at_line 'CRM/Core/BAO/UFField.php' 109 edit_at_line 'CRM/Core/BAO/UFField.php' 363 edit_at_line 'CRM/Core/BAO/UFField.php' 453 edit_at_line 'CRM/Core/BAO/UFField.php' 731 edit_at_line 'CRM/Contact/BAO/Individual.php' 413 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 76 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 804 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 659 edit_at_line 'CRM/Member/BAO/Membership.php' 449 edit_at_line 'CRM/Member/BAO/Membership.php' 1925 edit_at_line 'CRM/Member/BAO/Membership.php' 2035 edit_at_line 'CRM/Member/BAO/MembershipType.php' 481 edit_at_line 'CRM/Member/BAO/MembershipType.php' 588 edit_at_line 'CRM/Member/BAO/MembershipType.php' 608 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 766 edit_at_line 'CRM/Contact/BAO/Relationship.php' 375 edit_at_line 'CRM/Contact/BAO/Relationship.php' 671 edit_at_line 'CRM/Contact/BAO/Relationship.php' 742 edit_at_line 'CRM/Core/BAO/Email.php' 120 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.PHP.NonExecutableCode.ReturnNotRequired' echo 'Messages:Array ( [0] => Empty return statement not required here ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/CustomField.php:1107 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomField.php' 1107 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' 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/Core/BAO/CustomField.php:1107 [1] => CRM/Core/BAO/CustomField.php:1618 [2] => CRM/Contact/BAO/GroupContactCache.php:618 [3] => CRM/Core/BAO/UFField.php:457 [4] => CRM/Core/BAO/UFField.php:834 [5] => CRM/Contact/BAO/Individual.php:59 [6] => CRM/Core/BAO/ConfigSetting.php:231 [7] => CRM/Member/BAO/Membership.php:680 [8] => CRM/Member/BAO/Membership.php:1765 [9] => CRM/Contact/BAO/Relationship.php:1712 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomField.php' 1107 edit_at_line 'CRM/Core/BAO/CustomField.php' 1618 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 618 edit_at_line 'CRM/Core/BAO/UFField.php' 457 edit_at_line 'CRM/Core/BAO/UFField.php' 834 edit_at_line 'CRM/Contact/BAO/Individual.php' 59 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 231 edit_at_line 'CRM/Member/BAO/Membership.php' 680 edit_at_line 'CRM/Member/BAO/Membership.php' 1765 edit_at_line 'CRM/Contact/BAO/Relationship.php' 1712 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"getDisplayValueCommon\" [1] => Visibility must be declared on method \"setProfileDefaults\" [2] => Visibility must be declared on method \"formatCustomField\" [3] => Visibility must be declared on method \"postProcess\" [4] => Visibility must be declared on method \"addContactsToGroup\" [5] => Visibility must be declared on method \"removeContactsFromGroup\" [6] => Visibility must be declared on method \"getContactGroup\" [7] => Visibility must be declared on method \"bulkAddContactsToGroup\" [8] => Visibility must be declared on method \"__construct\" [9] => Visibility must be declared on method \"buildForm\" [10] => Visibility must be declared on method \"summary\" [11] => Visibility must be declared on method \"columns\" [12] => Visibility must be declared on method \"all\" [13] => Visibility must be declared on method \"select\" [14] => Visibility must be declared on method \"from\" [15] => Visibility must be declared on method \"where\" [16] => Visibility must be declared on method \"templateFile\" [17] => Visibility must be declared on method \"alterRow\" [18] => Visibility must be declared on method \"buildMembershipBlock\" [19] => Visibility must be declared on method \"renewMembershipFormWrapper\" [20] => Visibility must be declared on method \"getContactRelationshipType\" [21] => Visibility must be declared on method \"getRelationship\" [22] => Visibility must be declared on method \"preProcess\" ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/CustomField.php:1156 [1] => CRM/Core/BAO/CustomField.php:1369 [2] => CRM/Core/BAO/CustomField.php:1583 [3] => CRM/Core/BAO/CustomField.php:2241 [4] => CRM/Contact/BAO/GroupContact.php:132 [5] => CRM/Contact/BAO/GroupContact.php:182 [6] => CRM/Contact/BAO/GroupContact.php:338 [7] => CRM/Contact/BAO/GroupContact.php:723 [8] => tests/extensions/test.extension.manager.searchtest/main.php:12 [9] => tests/extensions/test.extension.manager.searchtest/main.php:23 [10] => tests/extensions/test.extension.manager.searchtest/main.php:55 [11] => tests/extensions/test.extension.manager.searchtest/main.php:68 [12] => tests/extensions/test.extension.manager.searchtest/main.php:89 [13] => tests/extensions/test.extension.manager.searchtest/main.php:99 [14] => tests/extensions/test.extension.manager.searchtest/main.php:113 [15] => tests/extensions/test.extension.manager.searchtest/main.php:131 [16] => tests/extensions/test.extension.manager.searchtest/main.php:175 [17] => tests/extensions/test.extension.manager.searchtest/main.php:186 [18] => CRM/Member/BAO/Membership.php:751 [19] => CRM/Member/BAO/Membership.php:1522 [20] => CRM/Contact/BAO/Relationship.php:410 [21] => CRM/Contact/BAO/Relationship.php:1048 [22] => CRM/Contact/Form/Search/Custom/Proximity.php:173 [23] => CRM/Grant/Form/Task/Delete.php:56 ) ' echo '' echo 'Total number of edits to perform: 24' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/CustomField.php' 1156 edit_at_line 'CRM/Core/BAO/CustomField.php' 1369 edit_at_line 'CRM/Core/BAO/CustomField.php' 1583 edit_at_line 'CRM/Core/BAO/CustomField.php' 2241 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 132 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 182 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 338 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 723 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 12 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 23 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 55 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 68 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 89 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 99 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 113 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 131 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 175 edit_at_line 'tests/extensions/test.extension.manager.searchtest/main.php' 186 edit_at_line 'CRM/Member/BAO/Membership.php' 751 edit_at_line 'CRM/Member/BAO/Membership.php' 1522 edit_at_line 'CRM/Contact/BAO/Relationship.php' 410 edit_at_line 'CRM/Contact/BAO/Relationship.php' 1048 edit_at_line 'CRM/Contact/Form/Search/Custom/Proximity.php' 173 edit_at_line 'CRM/Grant/Form/Task/Delete.php' 56 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $groupID does not match actual variable name $limit [1] => Doc comment for parameter $ids does not match actual variable name $contactId ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/GroupContactCache.php:120 [1] => CRM/Contact/BAO/Relationship.php:194 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 120 edit_at_line 'CRM/Contact/BAO/Relationship.php' 194 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' 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/GroupContactCache.php:470 [1] => CRM/Contact/BAO/GroupContact.php:139 [2] => CRM/Core/BAO/MessageTemplate.php:454 [3] => CRM/Core/BAO/MessageTemplate.php:475 [4] => CRM/Core/BAO/ConfigSetting.php:521 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 470 edit_at_line 'CRM/Contact/BAO/GroupContact.php' 139 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 454 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 475 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 521 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' 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/BAO/GroupContactCache.php:484 [1] => CRM/Contact/BAO/GroupContactCache.php:493 [2] => CRM/Contact/BAO/GroupContactCache.php:504 [3] => CRM/Contact/BAO/GroupContactCache.php:657 [4] => CRM/Contact/BAO/GroupContactCache.php:661 [5] => CRM/Core/BAO/ConfigSetting.php:74 [6] => CRM/Core/BAO/ConfigSetting.php:675 [7] => CRM/Core/BAO/ConfigSetting.php:694 [8] => CRM/Report/Form/Contribute/Repeat.php:400 [9] => CRM/Report/Form/Contribute/Repeat.php:620 [10] => CRM/Report/Form/Contribute/Repeat.php:704 [11] => CRM/Report/Form/Contribute/Repeat.php:712 [12] => CRM/Report/Form/Contribute/Repeat.php:856 [13] => CRM/Report/Form/Contribute/Repeat.php:861 [14] => CRM/Contact/BAO/Relationship.php:200 [15] => CRM/Report/Form/Event/IncomeCountSummary.php:373 ) ' echo '' echo 'Total number of edits to perform: 16' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 484 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 493 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 504 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 657 edit_at_line 'CRM/Contact/BAO/GroupContactCache.php' 661 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 74 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 675 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 694 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 400 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 620 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 704 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 712 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 856 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 861 edit_at_line 'CRM/Contact/BAO/Relationship.php' 200 edit_at_line 'CRM/Report/Form/Event/IncomeCountSummary.php' 373 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: ) [1] => A comma should follow the last multiline array item. Found: '\''contact_type'\'' [2] => A comma should follow the last multiline array item. Found: '\''campaign_search_voter_for'\'' [3] => A comma should follow the last multiline array item. Found: '\''sortOrder'\'' [4] => A comma should follow the last multiline array item. Found: '\''mm/dd'\'' [5] => A comma should follow the last multiline array item. Found: '\''yy-mm'\'' [6] => A comma should follow the last multiline array item. Found: '\''M yy'\'' [7] => A comma should follow the last multiline array item. Found: '\''yy'\'' [8] => A comma should follow the last multiline array item. Found: '\''html'\'' [9] => A comma should follow the last multiline array item. Found: ] [10] => A comma should follow the last multiline array item. Found: $cnt [11] => A comma should follow the last multiline array item. Found: '\''endDate'\'' [12] => A comma should follow the last multiline array item. Found: '\''post'\'' [13] => A comma should follow the last multiline array item. Found: '\''last_name'\'' [14] => A comma should follow the last multiline array item. Found: $spaces [15] => A comma should follow the last multiline array item. Found: _availableRegistrations [16] => A comma should follow the last multiline array item. Found: '\''defaultValues'\'' [17] => A comma should follow the last multiline array item. Found: '\''Household'\'' ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFField.php:805 [1] => CRM/Campaign/Page/AJAX.php:161 [2] => CRM/Campaign/Page/AJAX.php:177 [3] => CRM/Campaign/Page/AJAX.php:502 [4] => CRM/Campaign/Page/AJAX.php:549 [5] => CRM/Campaign/Page/AJAX.php:638 [6] => CRM/Campaign/Page/AJAX.php:741 [7] => CRM/Campaign/Page/AJAX.php:839 [8] => CRM/Contact/BAO/Individual.php:277 [9] => CRM/Contact/BAO/Individual.php:286 [10] => CRM/Contact/BAO/Individual.php:291 [11] => CRM/Contact/BAO/Individual.php:296 [12] => CRM/Contact/BAO/Individual.php:309 [13] => CRM/Contact/BAO/Individual.php:318 [14] => CRM/Contact/BAO/Individual.php:323 [15] => CRM/Contact/BAO/Individual.php:328 [16] => CRM/Core/BAO/MessageTemplate.php:232 [17] => CRM/Core/BAO/MessageTemplate.php:382 [18] => CRM/Core/BAO/MessageTemplate.php:484 [19] => CRM/Member/BAO/MembershipType.php:170 [20] => CRM/Member/BAO/MembershipType.php:179 [21] => CRM/Member/BAO/MembershipType.php:308 [22] => CRM/Event/Form/Registration/AdditionalParticipant.php:181 [23] => CRM/Event/Form/Registration/AdditionalParticipant.php:189 [24] => CRM/Event/Form/Registration/AdditionalParticipant.php:261 [25] => CRM/Event/Form/Registration/AdditionalParticipant.php:267 [26] => CRM/Event/Form/Registration/AdditionalParticipant.php:274 [27] => CRM/Event/Form/Registration/AdditionalParticipant.php:368 [28] => CRM/Event/Form/Registration/AdditionalParticipant.php:490 [29] => CRM/Event/Form/Registration/AdditionalParticipant.php:850 [30] => CRM/Contribute/Form/ContributionPage/Settings.php:210 ) ' echo '' echo 'Total number of edits to perform: 31' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFField.php' 805 edit_at_line 'CRM/Campaign/Page/AJAX.php' 161 edit_at_line 'CRM/Campaign/Page/AJAX.php' 177 edit_at_line 'CRM/Campaign/Page/AJAX.php' 502 edit_at_line 'CRM/Campaign/Page/AJAX.php' 549 edit_at_line 'CRM/Campaign/Page/AJAX.php' 638 edit_at_line 'CRM/Campaign/Page/AJAX.php' 741 edit_at_line 'CRM/Campaign/Page/AJAX.php' 839 edit_at_line 'CRM/Contact/BAO/Individual.php' 277 edit_at_line 'CRM/Contact/BAO/Individual.php' 286 edit_at_line 'CRM/Contact/BAO/Individual.php' 291 edit_at_line 'CRM/Contact/BAO/Individual.php' 296 edit_at_line 'CRM/Contact/BAO/Individual.php' 309 edit_at_line 'CRM/Contact/BAO/Individual.php' 318 edit_at_line 'CRM/Contact/BAO/Individual.php' 323 edit_at_line 'CRM/Contact/BAO/Individual.php' 328 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 232 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 382 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 484 edit_at_line 'CRM/Member/BAO/MembershipType.php' 170 edit_at_line 'CRM/Member/BAO/MembershipType.php' 179 edit_at_line 'CRM/Member/BAO/MembershipType.php' 308 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 181 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 189 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 261 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 267 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 274 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 368 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 490 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 850 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 210 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => is_integer() is a function name alias, use is_int() instead [1] => sizeof() is a function name alias, use count() instead ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/UFField.php:1032 [1] => CRM/Core/BAO/Cache.php:379 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/UFField.php' 1032 edit_at_line 'CRM/Core/BAO/Cache.php' 379 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' 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/Page/AJAX.php:568 [1] => CRM/Campaign/Page/AJAX.php:669 [2] => CRM/Campaign/Page/AJAX.php:772 [3] => CRM/Event/Form/Registration/AdditionalParticipant.php:780 [4] => CRM/Core/Payment/eWAY.php:92 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Page/AJAX.php' 568 edit_at_line 'CRM/Campaign/Page/AJAX.php' 669 edit_at_line 'CRM/Campaign/Page/AJAX.php' 772 edit_at_line 'CRM/Event/Form/Registration/AdditionalParticipant.php' 780 edit_at_line 'CRM/Core/Payment/eWAY.php' 92 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Commenting.DocCommentAlignment.SpaceAfterStar' echo 'Messages:Array ( [0] => Expected 1 space after asterisk; 3 found ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/GroupContact.php:800 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/GroupContact.php' 800 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Commenting.DocCommentAlignment.SpaceAfterStar!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.SeePunctuation' echo 'Messages:Array ( [0] => Trailing punctuation for @see references is not allowed. ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/GroupContact.php:800 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/GroupContact.php' 800 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SeePunctuation!' 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/BAO/MessageTemplate.php:105 [1] => CRM/Core/BAO/ConfigSetting.php:50 [2] => CRM/Core/BAO/ConfigSetting.php:66 [3] => CRM/Core/BAO/ConfigSetting.php:147 [4] => CRM/Core/BAO/ConfigSetting.php:181 [5] => CRM/Contact/BAO/Relationship.php:585 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 105 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 50 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 66 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 147 edit_at_line 'CRM/Core/BAO/ConfigSetting.php' 181 edit_at_line 'CRM/Contact/BAO/Relationship.php' 585 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Core/BAO/MessageTemplate.php:282 [1] => CRM/Core/BAO/MessageTemplate.php:290 [2] => CRM/Core/BAO/MessageTemplate.php:412 [3] => CRM/Core/Payment/eWAY.php:147 [4] => CRM/Core/Payment/eWAY.php:153 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 282 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 290 edit_at_line 'CRM/Core/BAO/MessageTemplate.php' 412 edit_at_line 'CRM/Core/Payment/eWAY.php' 147 edit_at_line 'CRM/Core/Payment/eWAY.php' 153 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' 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/Member/BAO/MembershipTypeTest.php:69 [1] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:99 [2] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:126 [3] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:158 [4] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:184 [5] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:214 [6] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:239 [7] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:266 [8] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:292 [9] => tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php:335 [10] => CRM/Core/Payment/eWAY.php:115 [11] => CRM/Core/Payment/eWAY.php:130 [12] => CRM/Core/Payment/eWAY.php:426 [13] => CRM/Core/Payment/eWAY.php:438 [14] => CRM/Core/Payment/eWAY.php:453 [15] => CRM/Core/Payment/eWAY.php:474 ) ' echo '' echo 'Total number of edits to perform: 16' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 69 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 99 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 126 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 158 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 184 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 214 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 239 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 266 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 292 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php' 335 edit_at_line 'CRM/Core/Payment/eWAY.php' 115 edit_at_line 'CRM/Core/Payment/eWAY.php' 130 edit_at_line 'CRM/Core/Payment/eWAY.php' 426 edit_at_line 'CRM/Core/Payment/eWAY.php' 438 edit_at_line 'CRM/Core/Payment/eWAY.php' 453 edit_at_line 'CRM/Core/Payment/eWAY.php' 474 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.$InReturnType' echo 'Messages:Array ( [0] => @return data type must not contain \"$\" ) ' echo 'Lines:Array ( [0] => CRM/Member/BAO/Membership.php:600 [1] => CRM/Member/BAO/Membership.php:615 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/BAO/Membership.php' 600 edit_at_line 'CRM/Member/BAO/Membership.php' 615 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.$InReturnType!' 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/Member/BAO/Membership.php:1901 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/BAO/Membership.php' 1901 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 12 spaces but found 0 [1] => Array indentation error, expected 6 spaces but found 8 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Contribute/Repeat.php:153 [1] => CRM/Report/Form/Contribute/Repeat.php:154 [2] => CRM/Report/Form/Contribute/Repeat.php:164 [3] => CRM/Report/Form/Contribute/Repeat.php:165 [4] => CRM/Contribute/Form/ContributionPage/Settings.php:353 [5] => CRM/Contribute/Form/ContributionPage/Settings.php:358 [6] => CRM/Contribute/Form/ContributionPage/Settings.php:360 [7] => CRM/Contribute/Form/ContributionPage/Settings.php:364 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 153 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 154 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 164 edit_at_line 'CRM/Report/Form/Contribute/Repeat.php' 165 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 353 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 358 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 360 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 364 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/Member/BAO/MembershipType.php:755 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/BAO/MembershipType.php' 755 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.ContentAfterOpen!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Arrays.ArrayDeclaration.SpaceAfterKeyword' echo 'Messages:Array ( [0] => There must be no space between the \"array\" keyword and the opening parenthesis ) ' echo 'Lines:Array ( [0] => CRM/Contribute/Form/ContributionPage/Settings.php:147 [1] => CRM/Contribute/Form/ContributionPage/Settings.php:154 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 147 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 154 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Arrays.ArrayDeclaration.SpaceAfterKeyword!' 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/Contribute/Form/ContributionPage/Settings.php:158 [1] => CRM/Contribute/Form/ContributionPage/Settings.php:159 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 158 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 159 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EndLine!' 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] => Civi/Core/Transaction/Manager.php:156 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'Civi/Core/Transaction/Manager.php' 156 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' echo '' echo 'Yay!' echo '' fi