#!/bin/bash ## usage: bash batch-19.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] => api/v3/Address.php:143 [1] => CRM/Utils/System/Drupal8.php:425 [2] => CRM/Financial/BAO/PaymentProcessorType.php:89 [3] => api/v3/Website.php:101 [4] => api/v3/PaymentProcessor.php:81 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Address.php' 143 edit_at_line 'CRM/Utils/System/Drupal8.php' 425 edit_at_line 'CRM/Financial/BAO/PaymentProcessorType.php' 89 edit_at_line 'api/v3/Website.php' 101 edit_at_line 'api/v3/PaymentProcessor.php' 81 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 [1] => Return comment indentation must be 3 spaces, found 2 spaces ) ' echo 'Lines:Array ( [0] => api/v3/Address.php:151 [1] => api/v3/CustomGroup.php:118 [2] => api/v3/MailingEventQueue.php:47 [3] => api/v3/Participant.php:51 [4] => api/v3/Participant.php:166 [5] => api/v3/MessageTemplate.php:64 [6] => api/v3/MailingEventUnsubscribe.php:48 [7] => api/v3/UFMatch.php:60 [8] => api/v3/UFMatch.php:89 [9] => api/v3/UFGroup.php:58 [10] => api/v3/UFGroup.php:75 [11] => CRM/Utils/System/Drupal8.php:485 [12] => api/v3/WordReplacement.php:62 [13] => api/v3/Phone.php:75 [14] => api/v3/SurveyRespondant.php:51 ) ' echo '' echo 'Total number of edits to perform: 15' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Address.php' 151 edit_at_line 'api/v3/CustomGroup.php' 118 edit_at_line 'api/v3/MailingEventQueue.php' 47 edit_at_line 'api/v3/Participant.php' 51 edit_at_line 'api/v3/Participant.php' 166 edit_at_line 'api/v3/MessageTemplate.php' 64 edit_at_line 'api/v3/MailingEventUnsubscribe.php' 48 edit_at_line 'api/v3/UFMatch.php' 60 edit_at_line 'api/v3/UFMatch.php' 89 edit_at_line 'api/v3/UFGroup.php' 58 edit_at_line 'api/v3/UFGroup.php' 75 edit_at_line 'CRM/Utils/System/Drupal8.php' 485 edit_at_line 'api/v3/WordReplacement.php' 62 edit_at_line 'api/v3/Phone.php' 75 edit_at_line 'api/v3/SurveyRespondant.php' 51 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"fromApiInput\" [1] => Visibility must be declared on method \"toApiOutput\" [2] => Visibility must be declared on method \"__construct\" [3] => Visibility must be declared on method \"initialize\" [4] => Visibility must be declared on method \"query\" [5] => Visibility must be declared on method \"invoke\" [6] => Visibility must be declared on method \"table\" [7] => Visibility must be declared on method \"run\" [8] => Visibility must be declared on method \"importCSVComponent\" [9] => Visibility must be declared on method \"buildQuickForm\" [10] => Visibility must be declared on method \"all\" [11] => Visibility must be declared on method \"sql\" [12] => Visibility must be declared on method \"_testEventRegistration\" [13] => Visibility must be declared on method \"preProcess\" [14] => Visibility must be declared on method \"createTestObject\" ) ' echo 'Lines:Array ( [0] => api/Wrapper.php:14 [1] => api/Wrapper.php:23 [2] => bin/deprecated/action.cronjob.php:38 [3] => bin/deprecated/action.cronjob.php:59 [4] => bin/deprecated/UpdateMembershipRecord.php:48 [5] => bin/deprecated/UpdateMembershipRecord.php:69 [6] => CRM/Utils/Weight.php:294 [7] => tests/phpunit/api/v3/AllTests.php:51 [8] => CRM/Utils/Hook/Soap.php:70 [9] => bin/deprecated/UpdatePledgeRecord.php:45 [10] => bin/deprecated/UpdateMembershipReminderDate.php:40 [11] => bin/deprecated/UpdateMembershipReminderDate.php:61 [12] => CRM/Utils/Migrate/ExportJSON.php:188 [13] => CRM/Utils/Migrate/ExportJSON.php:593 [14] => tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php:58 [15] => CRM/Contact/Form/Edit/TagsAndGroups.php:67 [16] => CRM/Contact/Form/Search/Custom/ZipCodeRange.php:99 [17] => CRM/Contact/Form/Search/Custom/TagContributions.php:96 [18] => CRM/Contact/Form/Search/Custom/Sample.php:109 [19] => CRM/Contact/Form/Search/Custom/Base.php:98 [20] => CRM/Contact/Form/Search/Custom/ActivitySearch.php:161 [21] => CRM/Contact/Form/Search/Custom/ContributionAggregate.php:118 [22] => CRM/Contact/Form/Search/Custom/DateAdded.php:124 [23] => tests/phpunit/WebTest/Event/MultiprofileEventTest.php:639 [24] => tests/phpunit/WebTest/Release/ReleaseTestCase.php:53 [25] => bin/deprecated/RespondentProcessor.php:43 [26] => CRM/Activity/Form/Task/Email.php:64 [27] => bin/deprecated/ParticipantProcessor.php:44 [28] => tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php:899 ) ' echo '' echo 'Total number of edits to perform: 29' if ask_continue 'Edit these files?'; then edit_at_line 'api/Wrapper.php' 14 edit_at_line 'api/Wrapper.php' 23 edit_at_line 'bin/deprecated/action.cronjob.php' 38 edit_at_line 'bin/deprecated/action.cronjob.php' 59 edit_at_line 'bin/deprecated/UpdateMembershipRecord.php' 48 edit_at_line 'bin/deprecated/UpdateMembershipRecord.php' 69 edit_at_line 'CRM/Utils/Weight.php' 294 edit_at_line 'tests/phpunit/api/v3/AllTests.php' 51 edit_at_line 'CRM/Utils/Hook/Soap.php' 70 edit_at_line 'bin/deprecated/UpdatePledgeRecord.php' 45 edit_at_line 'bin/deprecated/UpdateMembershipReminderDate.php' 40 edit_at_line 'bin/deprecated/UpdateMembershipReminderDate.php' 61 edit_at_line 'CRM/Utils/Migrate/ExportJSON.php' 188 edit_at_line 'CRM/Utils/Migrate/ExportJSON.php' 593 edit_at_line 'tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php' 58 edit_at_line 'CRM/Contact/Form/Edit/TagsAndGroups.php' 67 edit_at_line 'CRM/Contact/Form/Search/Custom/ZipCodeRange.php' 99 edit_at_line 'CRM/Contact/Form/Search/Custom/TagContributions.php' 96 edit_at_line 'CRM/Contact/Form/Search/Custom/Sample.php' 109 edit_at_line 'CRM/Contact/Form/Search/Custom/Base.php' 98 edit_at_line 'CRM/Contact/Form/Search/Custom/ActivitySearch.php' 161 edit_at_line 'CRM/Contact/Form/Search/Custom/ContributionAggregate.php' 118 edit_at_line 'CRM/Contact/Form/Search/Custom/DateAdded.php' 124 edit_at_line 'tests/phpunit/WebTest/Event/MultiprofileEventTest.php' 639 edit_at_line 'tests/phpunit/WebTest/Release/ReleaseTestCase.php' 53 edit_at_line 'bin/deprecated/RespondentProcessor.php' 43 edit_at_line 'CRM/Activity/Form/Task/Email.php' 64 edit_at_line 'bin/deprecated/ParticipantProcessor.php' 44 edit_at_line 'tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php' 899 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' 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: \"Action\" [2] => A comma should follow the last multiline array item. Found: '\''http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades'\'' [3] => A comma should follow the last multiline array item. Found: '\''replacePermission'\'' [4] => A comma should follow the last multiline array item. Found: '\''schedule mailings'\'' [5] => A comma should follow the last multiline array item. Found: '\''Failed'\'' [6] => A comma should follow the last multiline array item. Found: ] [7] => A comma should follow the last multiline array item. Found: '\''endDate'\'' [8] => A comma should follow the last multiline array item. Found: '\''edit-2-delete-in-civicase'\'' [9] => A comma should follow the last multiline array item. Found: '\''Added'\'' [10] => A comma should follow the last multiline array item. Found: NULL [11] => A comma should follow the last multiline array item. Found: $msg [12] => A comma should follow the last multiline array item. Found: '\''edit-1-make-online-contributions'\'' [13] => A comma should follow the last multiline array item. Found: '\''address'\'' [14] => A comma should follow the last multiline array item. Found: '\''customString'\'' [15] => A comma should follow the last multiline array item. Found: '\''unMatchCount'\'' [16] => A comma should follow the last multiline array item. Found: '\''CRM_Contact_Form_Domain'\'' [17] => A comma should follow the last multiline array item. Found: $gid [18] => A comma should follow the last multiline array item. Found: $uploadFileSize [19] => A comma should follow the last multiline array item. Found: '\''%count contacts already had this tag'\'' [20] => A comma should follow the last multiline array item. Found: '\''edit-1-profile-view'\'' [21] => A comma should follow the last multiline array item. Found: '\''unparsedAddressCount'\'' [22] => A comma should follow the last multiline array item. Found: '\''crm-select2'\'' [23] => A comma should follow the last multiline array item. Found: '\''dashletFullscreen'\'' [24] => A comma should follow the last multiline array item. Found: '\''%count activities already had this tag'\'' [25] => A comma should follow the last multiline array item. Found: 0 [26] => A comma should follow the last multiline array item. Found: '\''blob'\'' [27] => A comma should follow the last multiline array item. Found: $letterTypeValue [28] => A comma should follow the last multiline array item. Found: $toEmail [29] => A comma should follow the last multiline array item. Found: '\''civicrm_im'\'' [30] => A comma should follow the last multiline array item. Found: $contributionId ) ' echo 'Lines:Array ( [0] => Civi/Core/Transaction/Frame.php:171 [1] => Civi/Core/Transaction/Frame.php:177 [2] => tests/phpunit/api/v3/GrantTest.php:93 [3] => CRM/Upgrade/Page/Cleanup.php:45 [4] => CRM/Upgrade/Page/Cleanup.php:56 [5] => CRM/Upgrade/Incremental/php/ThreeThree.php:365 [6] => CRM/Upgrade/Incremental/php/ThreeThree.php:371 [7] => bin/deprecated/UpdatePledgeRecord.php:75 [8] => tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php:420 [9] => tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php:316 [10] => tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php:406 [11] => tests/phpunit/WebTest/Case/AddCaseTest.php:50 [12] => tests/phpunit/WebTest/Case/AddCaseTest.php:158 [13] => tests/phpunit/WebTest/Case/ActivityToCaseTest.php:50 [14] => tests/phpunit/WebTest/Case/ActivityToCaseTest.php:101 [15] => tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php:328 [16] => tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php:453 [17] => CRM/Grant/BAO/Grant.php:401 [18] => tests/phpunit/WebTest/Member/InheritedMembershipTest.php:121 [19] => tests/phpunit/api/v3/JobProcessMailingTest.php:108 [20] => CRM/Contact/Form/Edit/Email.php:72 [21] => CRM/Contact/Form/Edit/IM.php:69 [22] => CRM/Contact/Form/GroupContact.php:106 [23] => tests/phpunit/WebTest/Event/PCPAddTest.php:44 [24] => CRM/Contact/Form/RelatedContact.php:170 [25] => tests/phpunit/api/v3/CustomValueTest.php:66 [26] => CRM/Activity/Import/Form/Summary.php:108 [27] => tests/phpunit/api/v3/GroupNestingTest.php:111 [28] => CRM/Contact/Form/Location.php:59 [29] => tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php:209 [30] => CRM/Contact/Form/Search/Custom.php:73 [31] => CRM/Activity/Import/Form/DataSource.php:70 [32] => CRM/Contact/Form/Task/AddToTag.php:151 [33] => tests/phpunit/WebTest/Profile/DedupeTest.php:44 [34] => tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php:123 [35] => tests/phpunit/WebTest/Profile/ProfileCountryState.php:65 [36] => CRM/Contact/Import/Form/Summary.php:116 [37] => CRM/Contact/Import/Form/Preview.php:152 [38] => CRM/ACL/Page/ACLBasic.php:115 [39] => CRM/ACL/Page/EntityRole.php:129 [40] => CRM/Activity/Form/ActivityView.php:64 [41] => CRM/Activity/Form/Task/AddToTag.php:152 [42] => CRM/Contact/Form/Task/PickProfile.php:80 [43] => CRM/Contact/Form/Task/Print.php:65 [44] => CRM/Contact/Form/DedupeRules.php:293 [45] => CRM/Activity/Page/Tab.php:207 [46] => CRM/Admin/Form/Setting/Smtp.php:123 [47] => tests/phpunit/CRM/Core/BAO/LocationTest.php:53 [48] => tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php:152 [49] => CRM/Contribute/Import/Form/DataSource.php:71 ) ' echo '' echo 'Total number of edits to perform: 50' if ask_continue 'Edit these files?'; then edit_at_line 'Civi/Core/Transaction/Frame.php' 171 edit_at_line 'Civi/Core/Transaction/Frame.php' 177 edit_at_line 'tests/phpunit/api/v3/GrantTest.php' 93 edit_at_line 'CRM/Upgrade/Page/Cleanup.php' 45 edit_at_line 'CRM/Upgrade/Page/Cleanup.php' 56 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeThree.php' 365 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeThree.php' 371 edit_at_line 'bin/deprecated/UpdatePledgeRecord.php' 75 edit_at_line 'tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php' 420 edit_at_line 'tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php' 316 edit_at_line 'tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php' 406 edit_at_line 'tests/phpunit/WebTest/Case/AddCaseTest.php' 50 edit_at_line 'tests/phpunit/WebTest/Case/AddCaseTest.php' 158 edit_at_line 'tests/phpunit/WebTest/Case/ActivityToCaseTest.php' 50 edit_at_line 'tests/phpunit/WebTest/Case/ActivityToCaseTest.php' 101 edit_at_line 'tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php' 328 edit_at_line 'tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php' 453 edit_at_line 'CRM/Grant/BAO/Grant.php' 401 edit_at_line 'tests/phpunit/WebTest/Member/InheritedMembershipTest.php' 121 edit_at_line 'tests/phpunit/api/v3/JobProcessMailingTest.php' 108 edit_at_line 'CRM/Contact/Form/Edit/Email.php' 72 edit_at_line 'CRM/Contact/Form/Edit/IM.php' 69 edit_at_line 'CRM/Contact/Form/GroupContact.php' 106 edit_at_line 'tests/phpunit/WebTest/Event/PCPAddTest.php' 44 edit_at_line 'CRM/Contact/Form/RelatedContact.php' 170 edit_at_line 'tests/phpunit/api/v3/CustomValueTest.php' 66 edit_at_line 'CRM/Activity/Import/Form/Summary.php' 108 edit_at_line 'tests/phpunit/api/v3/GroupNestingTest.php' 111 edit_at_line 'CRM/Contact/Form/Location.php' 59 edit_at_line 'tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php' 209 edit_at_line 'CRM/Contact/Form/Search/Custom.php' 73 edit_at_line 'CRM/Activity/Import/Form/DataSource.php' 70 edit_at_line 'CRM/Contact/Form/Task/AddToTag.php' 151 edit_at_line 'tests/phpunit/WebTest/Profile/DedupeTest.php' 44 edit_at_line 'tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php' 123 edit_at_line 'tests/phpunit/WebTest/Profile/ProfileCountryState.php' 65 edit_at_line 'CRM/Contact/Import/Form/Summary.php' 116 edit_at_line 'CRM/Contact/Import/Form/Preview.php' 152 edit_at_line 'CRM/ACL/Page/ACLBasic.php' 115 edit_at_line 'CRM/ACL/Page/EntityRole.php' 129 edit_at_line 'CRM/Activity/Form/ActivityView.php' 64 edit_at_line 'CRM/Activity/Form/Task/AddToTag.php' 152 edit_at_line 'CRM/Contact/Form/Task/PickProfile.php' 80 edit_at_line 'CRM/Contact/Form/Task/Print.php' 65 edit_at_line 'CRM/Contact/Form/DedupeRules.php' 293 edit_at_line 'CRM/Activity/Page/Tab.php' 207 edit_at_line 'CRM/Admin/Form/Setting/Smtp.php' 123 edit_at_line 'tests/phpunit/CRM/Core/BAO/LocationTest.php' 53 edit_at_line 'tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php' 152 edit_at_line 'CRM/Contribute/Import/Form/DataSource.php' 71 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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] => api/v3/CustomGroup.php:120 [1] => bin/csv/delete.php:34 [2] => bin/csv/export.php:36 [3] => bin/csv/import.php:33 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/CustomGroup.php' 120 edit_at_line 'bin/csv/delete.php' 34 edit_at_line 'bin/csv/export.php' 36 edit_at_line 'bin/csv/import.php' 33 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.Comma.NoSpace' echo 'Messages:Array ( [0] => Expected one space after the comma, 0 found ) ' echo 'Lines:Array ( [0] => api/v3/MailingEventQueue.php:55 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/MailingEventQueue.php' 55 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.NoSpace!' 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] => api/v3/MessageTemplate.php:62 [1] => CRM/Utils/Geocode/Yahoo.php:66 [2] => CRM/ACL/API.php:57 [3] => CRM/Extension/Mapper.php:150 [4] => CRM/Extension/Mapper.php:165 [5] => api/v3/MembershipType.php:103 [6] => CRM/Core/BAO/Website.php:134 [7] => CRM/Core/BAO/OptionValue.php:234 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/MessageTemplate.php' 62 edit_at_line 'CRM/Utils/Geocode/Yahoo.php' 66 edit_at_line 'CRM/ACL/API.php' 57 edit_at_line 'CRM/Extension/Mapper.php' 150 edit_at_line 'CRM/Extension/Mapper.php' 165 edit_at_line 'api/v3/MembershipType.php' 103 edit_at_line 'CRM/Core/BAO/Website.php' 134 edit_at_line 'CRM/Core/BAO/OptionValue.php' 234 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] => api/v3/MailingEventUnsubscribe.php:71 [1] => tests/mailing_test/controllerTest.js:12 [2] => CRM/Contact/Form/Inline/Email.php:121 [3] => CRM/Contact/Form/Task.php:260 [4] => CRM/Contact/Form/Task/HookSample.php:59 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/MailingEventUnsubscribe.php' 71 edit_at_line 'tests/mailing_test/controllerTest.js' 12 edit_at_line 'CRM/Contact/Form/Inline/Email.php' 121 edit_at_line 'CRM/Contact/Form/Task.php' 260 edit_at_line 'CRM/Contact/Form/Task/HookSample.php' 59 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Classes.ClassCreateInstance' echo 'Messages:Array ( [0] => Calling class constructors must always include parentheses ) ' echo 'Lines:Array ( [0] => CRM/Utils/Weight.php:306 [1] => tests/phpunit/api/v3/AllTests.php:59 [2] => CRM/Logging/Differ.php:84 [3] => CRM/Logging/Differ.php:314 [4] => CRM/Logging/Reverter.php:119 [5] => CRM/Logging/Reverter.php:192 [6] => tests/phpunit/AllTests.php:50 [7] => tests/phpunit/WebTest/AllTests.php:45 [8] => tests/phpunit/CRM/Core/BAO/IMTest.php:58 [9] => tests/phpunit/CRM/Event/AllTests.php:50 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Weight.php' 306 edit_at_line 'tests/phpunit/api/v3/AllTests.php' 59 edit_at_line 'CRM/Logging/Differ.php' 84 edit_at_line 'CRM/Logging/Differ.php' 314 edit_at_line 'CRM/Logging/Reverter.php' 119 edit_at_line 'CRM/Logging/Reverter.php' 192 edit_at_line 'tests/phpunit/AllTests.php' 50 edit_at_line 'tests/phpunit/WebTest/AllTests.php' 45 edit_at_line 'tests/phpunit/CRM/Core/BAO/IMTest.php' 58 edit_at_line 'tests/phpunit/CRM/Event/AllTests.php' 50 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => join() is a function name alias, use implode() instead [1] => fputs() is a function name alias, use fwrite() instead ) ' echo 'Lines:Array ( [0] => CRM/Utils/Geocode/Yahoo.php:121 [1] => distmaker/utils/joomlaxml.php:75 [2] => distmaker/utils/joomlaxml.php:109 [3] => install/civicrm.php:74 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Geocode/Yahoo.php' 121 edit_at_line 'distmaker/utils/joomlaxml.php' 75 edit_at_line 'distmaker/utils/joomlaxml.php' 109 edit_at_line 'install/civicrm.php' 74 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.WrongStyle' echo 'Messages:Array ( [0] => You must use \"/**\" style comments for a function comment ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/GrantTest.php:168 [1] => tests/phpunit/api/v3/GroupContactTest.php:86 [2] => tests/phpunit/api/v3/GroupContactTest.php:164 [3] => tests/phpunit/WebTest/Contact/SearchBuilderTest.php:384 [4] => tests/phpunit/WebTest/Contact/SearchBuilderTest.php:439 [5] => tests/phpunit/CRM/Utils/HookTest.php:72 [6] => tests/phpunit/CRM/Utils/HookTest.php:105 [7] => tests/phpunit/HelloTest.php:59 [8] => tests/phpunit/HelloTest.php:68 [9] => tests/phpunit/api/v3/MembershipStatusTest.php:136 [10] => tests/phpunit/api/v3/EmailTest.php:86 [11] => tests/phpunit/api/v3/DomainTest.php:151 [12] => bin/migrate/move.php:27 [13] => tests/phpunit/api/v3/MembershipTypeTest.php:78 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/GrantTest.php' 168 edit_at_line 'tests/phpunit/api/v3/GroupContactTest.php' 86 edit_at_line 'tests/phpunit/api/v3/GroupContactTest.php' 164 edit_at_line 'tests/phpunit/WebTest/Contact/SearchBuilderTest.php' 384 edit_at_line 'tests/phpunit/WebTest/Contact/SearchBuilderTest.php' 439 edit_at_line 'tests/phpunit/CRM/Utils/HookTest.php' 72 edit_at_line 'tests/phpunit/CRM/Utils/HookTest.php' 105 edit_at_line 'tests/phpunit/HelloTest.php' 59 edit_at_line 'tests/phpunit/HelloTest.php' 68 edit_at_line 'tests/phpunit/api/v3/MembershipStatusTest.php' 136 edit_at_line 'tests/phpunit/api/v3/EmailTest.php' 86 edit_at_line 'tests/phpunit/api/v3/DomainTest.php' 151 edit_at_line 'bin/migrate/move.php' 27 edit_at_line 'tests/phpunit/api/v3/MembershipTypeTest.php' 78 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' 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/Hook/Soap.php:76 [1] => CRM/Contact/Page/SavedSearch.php:69 [2] => bin/deprecated/UpdateAddress.php:277 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Hook/Soap.php' 76 edit_at_line 'CRM/Contact/Page/SavedSearch.php' 69 edit_at_line 'bin/deprecated/UpdateAddress.php' 277 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 2 spaces but found 4 [1] => Array indentation error, expected 6 spaces but found 8 ) ' echo 'Lines:Array ( [0] => settings/Event.setting.php:40 [1] => settings/Event.setting.php:53 [2] => tests/phpunit/WebTest/Import/AddressImportTest.php:94 [3] => tests/phpunit/WebTest/Import/AddressImportTest.php:102 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'settings/Event.setting.php' 40 edit_at_line 'settings/Event.setting.php' 53 edit_at_line 'tests/phpunit/WebTest/Import/AddressImportTest.php' 94 edit_at_line 'tests/phpunit/WebTest/Import/AddressImportTest.php' 102 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' 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/Report/BAO/Hook.php:94 [1] => CRM/Report/BAO/Hook.php:96 [2] => CRM/Contact/Form/Task/Merge.php:65 [3] => CRM/Activity/BAO/Query.php:463 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/BAO/Hook.php' 94 edit_at_line 'CRM/Report/BAO/Hook.php' 96 edit_at_line 'CRM/Contact/Form/Task/Merge.php' 65 edit_at_line 'CRM/Activity/BAO/Query.php' 463 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' 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/Event/Page/UserDashboard.php:44 [1] => CRM/Event/Page/UserDashboard.php:66 [2] => CRM/Grant/BAO/Grant.php:118 [3] => CRM/Event/Page/Tab.php:43 [4] => CRM/Event/Page/Tab.php:287 [5] => api/v3/SystemLog.php:63 [6] => CRM/Contact/Page/DedupeFind.php:54 [7] => api/v3/PledgePayment.php:135 [8] => CRM/Contact/Page/View/ContactSmartGroup.php:45 [9] => CRM/Contact/Form/Task/Map.php:152 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Page/UserDashboard.php' 44 edit_at_line 'CRM/Event/Page/UserDashboard.php' 66 edit_at_line 'CRM/Grant/BAO/Grant.php' 118 edit_at_line 'CRM/Event/Page/Tab.php' 43 edit_at_line 'CRM/Event/Page/Tab.php' 287 edit_at_line 'api/v3/SystemLog.php' 63 edit_at_line 'CRM/Contact/Page/DedupeFind.php' 54 edit_at_line 'api/v3/PledgePayment.php' 135 edit_at_line 'CRM/Contact/Page/View/ContactSmartGroup.php' 45 edit_at_line 'CRM/Contact/Form/Task/Map.php' 152 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/ACL/API.php:211 [1] => CRM/Financial/BAO/PaymentProcessorType.php:191 [2] => CRM/Contact/Page/View/Log.php:50 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/ACL/API.php' 211 edit_at_line 'CRM/Financial/BAO/PaymentProcessorType.php' 191 edit_at_line 'CRM/Contact/Page/View/Log.php' 50 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.CSS.ColourDefinition.NotLower' echo 'Messages:Array ( [0] => CSS colours must be defined in lowercase; expected #a70 but found #A70 ) ' echo 'Lines:Array ( [0] => install/template.css:58 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'install/template.css' 58 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.CSS.ColourDefinition.NotLower!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Commenting.DocCommentAlignment.NoSpaceAfterStar' echo 'Messages:Array ( [0] => Expected 1 space after asterisk; 0 found ) ' echo 'Lines:Array ( [0] => tests/phpunit/WebTest/Report/RolePermissionReportTest.php:99 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/WebTest/Report/RolePermissionReportTest.php' 99 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Commenting.DocCommentAlignment.NoSpaceAfterStar!' 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] => bin/cleanup42.php:31 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'bin/cleanup42.php' 31 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.IncorrectExact' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 6 spaces, found 8 ) ' echo 'Lines:Array ( [0] => tests/phpunit/WebTest/Member/StandaloneAddTest.php:253 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/WebTest/Member/StandaloneAddTest.php' 253 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!' 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/Report/Form/Membership/Summary.php:425 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Membership/Summary.php' 425 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi