#!/bin/bash
## usage: bash batch-20.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.ControlStructures.InlineControlStructure.NotAllowed'
echo 'Messages:Array
(
[0] => Inline control structures are not allowed
)
'
echo 'Lines:Array
(
[0] => CRM/Campaign/Form/Survey/TabHeader.php:167
)
'
echo ''
echo 'Total number of edits to perform: 1'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Campaign/Form/Survey/TabHeader.php' 167
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!'
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] => tests/phpunit/CRM/Core/BAO/SettingTest.php:118
[1] => CRM/Core/Payment/Elavon.php:25
[2] => CRM/Mailing/Event/BAO/Delivered.php:283
)
'
echo ''
echo 'Total number of edits to perform: 3'
if ask_continue 'Edit these files?'; then
edit_at_line 'tests/phpunit/CRM/Core/BAO/SettingTest.php' 118
edit_at_line 'CRM/Core/Payment/Elavon.php' 25
edit_at_line 'CRM/Mailing/Event/BAO/Delivered.php' 283
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.Classes.ClassCreateInstance'
echo 'Messages:Array
(
[0] => Calling class constructors must always include parentheses
)
'
echo 'Lines:Array
(
[0] => tests/phpunit/CRM/Core/AllTests.php:50
[1] => tests/phpunit/CRM/Contact/AllTests.php:50
[2] => tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php:72
[3] => tests/phpunit/CRM/Contribute/AllTests.php:50
[4] => tests/phpunit/CRM/Extension/AllTests.php:50
[5] => tests/phpunit/CRM/Extension/Container/AllTests.php:50
[6] => tests/phpunit/CRM/Pledge/AllTests.php:50
[7] => tests/phpunit/CRM/Member/Form/AllTests.php:50
[8] => tests/phpunit/CRM/Utils/Cache/AllTests.php:50
[9] => tests/phpunit/CRM/Queue/Queue/AllTests.php:50
[10] => tests/phpunit/CRM/Queue/AllTests.php:50
[11] => tests/phpunit/CRM/Extension/Manager/AllTests.php:50
[12] => tests/phpunit/CRM/Member/AllTests.php:50
[13] => tests/phpunit/CRM/Mailing/BAO/QueryTest.php:14
[14] => tests/phpunit/CRM/Case/AllTests.php:20
[15] => tests/phpunit/api/v3/UFMatchTest.php:59
[16] => tests/phpunit/Civi/AllTests.php:50
[17] => tests/phpunit/api/v3/UFJoinTest.php:57
[18] => tests/phpunit/api/v3/UFFieldTest.php:60
[19] => tests/phpunit/CRM/Activity/AllTests.php:50
[20] => tests/phpunit/CRM/AllTests.php:50
[21] => CRM/Mailing/Event/BAO/Reply.php:145
[22] => CRM/Core/Page/AJAX.php:76
[23] => CRM/Event/Form/ManageEvent/ScheduleReminders.php:67
)
'
echo ''
echo 'Total number of edits to perform: 24'
if ask_continue 'Edit these files?'; then
edit_at_line 'tests/phpunit/CRM/Core/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Contact/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php' 72
edit_at_line 'tests/phpunit/CRM/Contribute/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Extension/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Extension/Container/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Pledge/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Member/Form/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Utils/Cache/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Queue/Queue/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Queue/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Extension/Manager/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Member/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/Mailing/BAO/QueryTest.php' 14
edit_at_line 'tests/phpunit/CRM/Case/AllTests.php' 20
edit_at_line 'tests/phpunit/api/v3/UFMatchTest.php' 59
edit_at_line 'tests/phpunit/Civi/AllTests.php' 50
edit_at_line 'tests/phpunit/api/v3/UFJoinTest.php' 57
edit_at_line 'tests/phpunit/api/v3/UFFieldTest.php' 60
edit_at_line 'tests/phpunit/CRM/Activity/AllTests.php' 50
edit_at_line 'tests/phpunit/CRM/AllTests.php' 50
edit_at_line 'CRM/Mailing/Event/BAO/Reply.php' 145
edit_at_line 'CRM/Core/Page/AJAX.php' 76
edit_at_line 'CRM/Event/Form/ManageEvent/ScheduleReminders.php' 67
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!'
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/Admin/Form/Setting/Mapping.php:91
[1] => CRM/Mailing/Event/BAO/Queue.php:66
)
'
echo ''
echo 'Total number of edits to perform: 2'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Admin/Form/Setting/Mapping.php' 91
edit_at_line 'CRM/Mailing/Event/BAO/Queue.php' 66
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 \"__construct\"
[1] => Visibility must be declared on method \"preProcess\"
[2] => Visibility must be declared on method \"stringActionLinks\"
[3] => Visibility must be declared on method \"assertDBCompareValue\"
[4] => Visibility must be declared on method \"defaultReturnProperties\"
[5] => Visibility must be declared on method \"load\"
[6] => Visibility must be declared on method \"single\"
[7] => Visibility must be declared on method \"mailingQuery\"
)
'
echo 'Lines:Array
(
[0] => CRM/Campaign/StateMachine/Search.php:47
[1] => CRM/Campaign/Form/Task.php:84
[2] => CRM/Admin/Page/Persistent.php:55
[3] => CRM/Campaign/Form/Search/Petition.php:53
[4] => CRM/Campaign/Form/Gotv.php:57
[5] => CRM/Activity/Selector/Search.php:156
[6] => tests/phpunit/CiviTest/CiviDBAssert.php:153
[7] => CRM/Case/Form/Report.php:64
[8] => CRM/Case/BAO/Query.php:618
[9] => CRM/Case/Form/Task/Delete.php:63
[10] => CRM/Case/Form/Task/Restore.php:56
[11] => CRM/Case/StateMachine/Search.php:47
[12] => CRM/Mailing/Selector/Search.php:150
[13] => CRM/Core/QuickForm/NestedAdvMultiSelect.php:64
[14] => CRM/Custom/Form/CustomData.php:52
[15] => CRM/Member/BAO/Query.php:395
[16] => CRM/Pledge/StateMachine/Search.php:47
[17] => CRM/Pledge/Selector/Search.php:149
[18] => CRM/Price/Form/DeleteSet.php:61
[19] => CRM/Pledge/BAO/Query.php:474
[20] => CRM/Member/StateMachine/Search.php:47
[21] => CRM/Core/Payment/PayPalIPN.php:229
[22] => CRM/Event/Form/Task/SaveSearch.php:55
[23] => CRM/Event/Form/Task/Email.php:70
[24] => CRM/Event/Selector/Search.php:160
[25] => CRM/Mailing/BAO/Recipients.php:66
[26] => CRM/Grant/StateMachine/Search.php:47
[27] => CRM/Grant/Selector/Search.php:146
[28] => CRM/Upgrade/Controller.php:40
)
'
echo ''
echo 'Total number of edits to perform: 29'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Campaign/StateMachine/Search.php' 47
edit_at_line 'CRM/Campaign/Form/Task.php' 84
edit_at_line 'CRM/Admin/Page/Persistent.php' 55
edit_at_line 'CRM/Campaign/Form/Search/Petition.php' 53
edit_at_line 'CRM/Campaign/Form/Gotv.php' 57
edit_at_line 'CRM/Activity/Selector/Search.php' 156
edit_at_line 'tests/phpunit/CiviTest/CiviDBAssert.php' 153
edit_at_line 'CRM/Case/Form/Report.php' 64
edit_at_line 'CRM/Case/BAO/Query.php' 618
edit_at_line 'CRM/Case/Form/Task/Delete.php' 63
edit_at_line 'CRM/Case/Form/Task/Restore.php' 56
edit_at_line 'CRM/Case/StateMachine/Search.php' 47
edit_at_line 'CRM/Mailing/Selector/Search.php' 150
edit_at_line 'CRM/Core/QuickForm/NestedAdvMultiSelect.php' 64
edit_at_line 'CRM/Custom/Form/CustomData.php' 52
edit_at_line 'CRM/Member/BAO/Query.php' 395
edit_at_line 'CRM/Pledge/StateMachine/Search.php' 47
edit_at_line 'CRM/Pledge/Selector/Search.php' 149
edit_at_line 'CRM/Price/Form/DeleteSet.php' 61
edit_at_line 'CRM/Pledge/BAO/Query.php' 474
edit_at_line 'CRM/Member/StateMachine/Search.php' 47
edit_at_line 'CRM/Core/Payment/PayPalIPN.php' 229
edit_at_line 'CRM/Event/Form/Task/SaveSearch.php' 55
edit_at_line 'CRM/Event/Form/Task/Email.php' 70
edit_at_line 'CRM/Event/Selector/Search.php' 160
edit_at_line 'CRM/Mailing/BAO/Recipients.php' 66
edit_at_line 'CRM/Grant/StateMachine/Search.php' 47
edit_at_line 'CRM/Grant/Selector/Search.php' 146
edit_at_line 'CRM/Upgrade/Controller.php' 40
echo '==============================================================='
echo ''
echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!'
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/Case/BAO/CaseTest.php:68
[1] => tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php:43
[2] => tests/phpunit/api/v3/ProductTest.php:51
[3] => tests/phpunit/api/v3/TaxContributionPageTest.php:368
[4] => tests/phpunit/api/v3/RelationshipTest.php:723
[5] => tests/phpunit/CRM/Bridge/OG/DrupalTest.php:46
[6] => CRM/Core/Smarty/plugins/modifier.substring.php:58
)
'
echo ''
echo 'Total number of edits to perform: 7'
if ask_continue 'Edit these files?'; then
edit_at_line 'tests/phpunit/CRM/Case/BAO/CaseTest.php' 68
edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php' 43
edit_at_line 'tests/phpunit/api/v3/ProductTest.php' 51
edit_at_line 'tests/phpunit/api/v3/TaxContributionPageTest.php' 368
edit_at_line 'tests/phpunit/api/v3/RelationshipTest.php' 723
edit_at_line 'tests/phpunit/CRM/Bridge/OG/DrupalTest.php' 46
edit_at_line 'CRM/Core/Smarty/plugins/modifier.substring.php' 58
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!'
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\" but found \"Array\" for function return type
)
'
echo 'Lines:Array
(
[0] => CRM/Campaign/Page/Petition/Confirm.php:106
[1] => tests/phpunit/CiviTest/AuthorizeNet.php:40
[2] => tests/phpunit/CiviTest/ContributionPage.php:48
[3] => tests/phpunit/CiviTest/Contact.php:94
[4] => tests/phpunit/CiviTest/Event.php:40
[5] => tests/phpunit/CiviTest/Participant.php:38
[6] => CRM/Mailing/Event/BAO/Unsubscribe.php:60
[7] => CRM/Mailing/Form/Schedule.php:199
[8] => CRM/Profile/Form/Edit.php:314
[9] => CRM/Core/Permission/DrupalBase.php:262
[10] => CRM/Core/Permission/UnitTests.php:50
[11] => CRM/Extension/Downloader.php:142
[12] => CRM/Extension/Browser.php:223
[13] => CRM/Mailing/Event/BAO/Confirm.php:60
)
'
echo ''
echo 'Total number of edits to perform: 14'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Campaign/Page/Petition/Confirm.php' 106
edit_at_line 'tests/phpunit/CiviTest/AuthorizeNet.php' 40
edit_at_line 'tests/phpunit/CiviTest/ContributionPage.php' 48
edit_at_line 'tests/phpunit/CiviTest/Contact.php' 94
edit_at_line 'tests/phpunit/CiviTest/Event.php' 40
edit_at_line 'tests/phpunit/CiviTest/Participant.php' 38
edit_at_line 'CRM/Mailing/Event/BAO/Unsubscribe.php' 60
edit_at_line 'CRM/Mailing/Form/Schedule.php' 199
edit_at_line 'CRM/Profile/Form/Edit.php' 314
edit_at_line 'CRM/Core/Permission/DrupalBase.php' 262
edit_at_line 'CRM/Core/Permission/UnitTests.php' 50
edit_at_line 'CRM/Extension/Downloader.php' 142
edit_at_line 'CRM/Extension/Browser.php' 223
edit_at_line 'CRM/Mailing/Event/BAO/Confirm.php' 60
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!'
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/Admin/Form/ScheduleReminders.php:70
[1] => CRM/Badge/BAO/Badge.php:271
[2] => CRM/Admin/Form/Preferences/Display.php:121
[3] => tests/phpunit/WebTest/Event/AddEventTest.php:766
[4] => CRM/Mailing/Page/Browse.php:133
[5] => CRM/Core/Smarty.php:120
[6] => CRM/Financial/Form/BatchTransaction.php:60
[7] => CRM/Financial/Page/BatchTransaction.php:107
[8] => CRM/Financial/BAO/ExportFormat/CSV.php:176
[9] => CRM/Core/BAO/UFMatch.php:145
)
'
echo ''
echo 'Total number of edits to perform: 10'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Admin/Form/ScheduleReminders.php' 70
edit_at_line 'CRM/Badge/BAO/Badge.php' 271
edit_at_line 'CRM/Admin/Form/Preferences/Display.php' 121
edit_at_line 'tests/phpunit/WebTest/Event/AddEventTest.php' 766
edit_at_line 'CRM/Mailing/Page/Browse.php' 133
edit_at_line 'CRM/Core/Smarty.php' 120
edit_at_line 'CRM/Financial/Form/BatchTransaction.php' 60
edit_at_line 'CRM/Financial/Page/BatchTransaction.php' 107
edit_at_line 'CRM/Financial/BAO/ExportFormat/CSV.php' 176
edit_at_line 'CRM/Core/BAO/UFMatch.php' 145
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: '\''civicrm_membership_payment'\''
[2] => A comma should follow the last multiline array item. Found: $priceSet
[3] => A comma should follow the last multiline array item. Found: '\''test.foo.bar'\''
[4] => A comma should follow the last multiline array item. Found: _id
[5] => A comma should follow the last multiline array item. Found: $gid
[6] => A comma should follow the last multiline array item. Found: '\''is_ssl'\''
[7] => A comma should follow the last multiline array item. Found: '\''value'\''
[8] => A comma should follow the last multiline array item. Found: '\''case_status'\''
[9] => A comma should follow the last multiline array item. Found: '\''dashletFullscreen'\''
[10] => A comma should follow the last multiline array item. Found: '\''edit-2-delete-in-civicase'\''
[11] => A comma should follow the last multiline array item. Found: _allowMultiClient
[12] => A comma should follow the last multiline array item. Found: '\''- select -'\''
[13] => A comma should follow the last multiline array item. Found: '\''edit-1-edit-all-contacts'\''
[14] => A comma should follow the last multiline array item. Found: '\''Paused'\''
[15] => A comma should follow the last multiline array item. Found: '\''assignee'\''
[16] => A comma should follow the last multiline array item. Found: ]
[17] => A comma should follow the last multiline array item. Found: _uploadDir
[18] => A comma should follow the last multiline array item. Found: '\''deceased_date'\''
[19] => A comma should follow the last multiline array item. Found: '\''duration_interval'\''
[20] => A comma should follow the last multiline array item. Found: '\''label'\''
[21] => A comma should follow the last multiline array item. Found: $uploadFileSize
[22] => A comma should follow the last multiline array item. Found: '\''unMatchCount'\''
[23] => A comma should follow the last multiline array item. Found: '\''registration_end_date'\''
[24] => A comma should follow the last multiline array item. Found: TRUE
[25] => A comma should follow the last multiline array item. Found: '\''event'\''
[26] => A comma should follow the last multiline array item. Found: $event_id
[27] => A comma should follow the last multiline array item. Found: $url
)
'
echo 'Lines:Array
(
[0] => CRM/Campaign/Page/DashBoard.php:478
[1] => tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php:95
[2] => CRM/Admin/Page/Job.php:124
[3] => CRM/Admin/Page/AJAX.php:118
[4] => tests/phpunit/CRM/Extension/Container/CollectionTest.php:58
[5] => CRM/Admin/Form/Tag.php:97
[6] => tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php:387
[7] => tests/phpunit/api/v3/WebsiteTest.php:96
[8] => CRM/Admin/Form/Job.php:86
[9] => CRM/Admin/Form/Mapping.php:70
[10] => CRM/Admin/Form/MailSettings.php:159
[11] => tests/phpunit/api/v3/SurveyTest.php:60
[12] => CRM/Admin/Form/OptionGroup.php:84
[13] => CRM/Case/Form/EditClient.php:71
[14] => tests/phpunit/WebTest/Case/AddCaseTypeTest.php:53
[15] => CRM/Case/Form/Activity/OpenCase.php:154
[16] => CRM/Admin/Form/Preferences/Address.php:46
[17] => tests/phpunit/WebTest/Contact/ProfileChecksumTest.php:110
[18] => CRM/Case/Info.php:202
[19] => tests/phpunit/WebTest/Case/CaseDashboardTest.php:50
[20] => CRM/Mailing/Selector/Browse.php:363
[21] => CRM/Core/Smarty/plugins/function.simpleActivityContacts.php:55
[22] => CRM/Mailing/Event/BAO/Subscribe.php:394
[23] => CRM/Custom/Form/MoveField.php:119
[24] => CRM/Core/QuickForm/Action/Upload.php:104
[25] => CRM/Profile/Form/Search.php:92
[26] => CRM/Pledge/Info.php:183
[27] => CRM/Member/Form/MembershipRenewal.php:374
[28] => CRM/Member/Form/MembershipBlock.php:85
[29] => CRM/Member/Import/Form/DataSource.php:71
[30] => CRM/Member/Import/Form/Summary.php:108
[31] => CRM/PCP/Page/PCPInfo.php:142
[32] => CRM/Financial/Form/FinancialAccount.php:101
[33] => CRM/Event/Form/ParticipantFeeSelection.php:184
[34] => CRM/Event/Form/ManageEvent/TabHeader.php:58
[35] => CRM/Event/Form/ManageEvent/Conference.php:84
[36] => CRM/Friend/Form.php:78
[37] => CRM/Event/Import/Form/DataSource.php:71
[38] => CRM/Event/Import/Form/Summary.php:107
[39] => CRM/Event/Form/Task/PickProfile.php:102
[40] => CRM/Event/Form/Task/Badge.php:100
[41] => CRM/Event/Cart/Page/CheckoutAJAX.php:17
[42] => CRM/Event/Cart/Page/AddToCart.php:21
[43] => CRM/Import/DataSource/CSV.php:77
[44] => CRM/Custom/Import/Form/DataSource.php:100
[45] => Civi/CCase/Analyzer.php:87
)
'
echo ''
echo 'Total number of edits to perform: 46'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Campaign/Page/DashBoard.php' 478
edit_at_line 'tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php' 95
edit_at_line 'CRM/Admin/Page/Job.php' 124
edit_at_line 'CRM/Admin/Page/AJAX.php' 118
edit_at_line 'tests/phpunit/CRM/Extension/Container/CollectionTest.php' 58
edit_at_line 'CRM/Admin/Form/Tag.php' 97
edit_at_line 'tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php' 387
edit_at_line 'tests/phpunit/api/v3/WebsiteTest.php' 96
edit_at_line 'CRM/Admin/Form/Job.php' 86
edit_at_line 'CRM/Admin/Form/Mapping.php' 70
edit_at_line 'CRM/Admin/Form/MailSettings.php' 159
edit_at_line 'tests/phpunit/api/v3/SurveyTest.php' 60
edit_at_line 'CRM/Admin/Form/OptionGroup.php' 84
edit_at_line 'CRM/Case/Form/EditClient.php' 71
edit_at_line 'tests/phpunit/WebTest/Case/AddCaseTypeTest.php' 53
edit_at_line 'CRM/Case/Form/Activity/OpenCase.php' 154
edit_at_line 'CRM/Admin/Form/Preferences/Address.php' 46
edit_at_line 'tests/phpunit/WebTest/Contact/ProfileChecksumTest.php' 110
edit_at_line 'CRM/Case/Info.php' 202
edit_at_line 'tests/phpunit/WebTest/Case/CaseDashboardTest.php' 50
edit_at_line 'CRM/Mailing/Selector/Browse.php' 363
edit_at_line 'CRM/Core/Smarty/plugins/function.simpleActivityContacts.php' 55
edit_at_line 'CRM/Mailing/Event/BAO/Subscribe.php' 394
edit_at_line 'CRM/Custom/Form/MoveField.php' 119
edit_at_line 'CRM/Core/QuickForm/Action/Upload.php' 104
edit_at_line 'CRM/Profile/Form/Search.php' 92
edit_at_line 'CRM/Pledge/Info.php' 183
edit_at_line 'CRM/Member/Form/MembershipRenewal.php' 374
edit_at_line 'CRM/Member/Form/MembershipBlock.php' 85
edit_at_line 'CRM/Member/Import/Form/DataSource.php' 71
edit_at_line 'CRM/Member/Import/Form/Summary.php' 108
edit_at_line 'CRM/PCP/Page/PCPInfo.php' 142
edit_at_line 'CRM/Financial/Form/FinancialAccount.php' 101
edit_at_line 'CRM/Event/Form/ParticipantFeeSelection.php' 184
edit_at_line 'CRM/Event/Form/ManageEvent/TabHeader.php' 58
edit_at_line 'CRM/Event/Form/ManageEvent/Conference.php' 84
edit_at_line 'CRM/Friend/Form.php' 78
edit_at_line 'CRM/Event/Import/Form/DataSource.php' 71
edit_at_line 'CRM/Event/Import/Form/Summary.php' 107
edit_at_line 'CRM/Event/Form/Task/PickProfile.php' 102
edit_at_line 'CRM/Event/Form/Task/Badge.php' 100
edit_at_line 'CRM/Event/Cart/Page/CheckoutAJAX.php' 17
edit_at_line 'CRM/Event/Cart/Page/AddToCart.php' 21
edit_at_line 'CRM/Import/DataSource/CSV.php' 77
edit_at_line 'CRM/Custom/Import/Form/DataSource.php' 100
edit_at_line 'Civi/CCase/Analyzer.php' 87
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Array.Array!'
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/Batch/Page/Batch.php:61
[1] => CRM/Admin/Page/Navigation.php:61
[2] => CRM/Contact/Page/View/Sunlight.php:40
[3] => CRM/Contact/Page/View/Tag.php:40
[4] => CRM/Mailing/Page/Tab.php:53
[5] => CRM/Pledge/Page/Tab.php:42
[6] => CRM/Core/Payment/Google.php:111
[7] => CRM/Core/Payment/PaymentExpress.php:132
[8] => CRM/Financial/Page/Batch.php:61
[9] => CRM/Friend/BAO/Friend.php:94
[10] => CRM/Group/Page/Group.php:48
)
'
echo ''
echo 'Total number of edits to perform: 11'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Batch/Page/Batch.php' 61
edit_at_line 'CRM/Admin/Page/Navigation.php' 61
edit_at_line 'CRM/Contact/Page/View/Sunlight.php' 40
edit_at_line 'CRM/Contact/Page/View/Tag.php' 40
edit_at_line 'CRM/Mailing/Page/Tab.php' 53
edit_at_line 'CRM/Pledge/Page/Tab.php' 42
edit_at_line 'CRM/Core/Payment/Google.php' 111
edit_at_line 'CRM/Core/Payment/PaymentExpress.php' 132
edit_at_line 'CRM/Financial/Page/Batch.php' 61
edit_at_line 'CRM/Friend/BAO/Friend.php' 94
edit_at_line 'CRM/Group/Page/Group.php' 48
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/Campaign/BAO/Campaign.php:51
[1] => api/v3/CustomField.php:143
[2] => CRM/Core/Smarty/plugins/block.crmRegion.php:21
[3] => CRM/Core/Smarty/plugins/function.docURL.php:50
[4] => CRM/Core/Smarty/plugins/function.help.php:49
)
'
echo ''
echo 'Total number of edits to perform: 5'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Campaign/BAO/Campaign.php' 51
edit_at_line 'api/v3/CustomField.php' 143
edit_at_line 'CRM/Core/Smarty/plugins/block.crmRegion.php' 21
edit_at_line 'CRM/Core/Smarty/plugins/function.docURL.php' 50
edit_at_line 'CRM/Core/Smarty/plugins/function.help.php' 49
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!'
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/Form/Domain.php:300
[1] => CRM/Contact/BAO/SearchCustom.php:163
[2] => CRM/Mailing/Form/Unsubscribe.php:111
)
'
echo ''
echo 'Total number of edits to perform: 3'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Contact/Form/Domain.php' 300
edit_at_line 'CRM/Contact/BAO/SearchCustom.php' 163
edit_at_line 'CRM/Mailing/Form/Unsubscribe.php' 111
echo '==============================================================='
echo ''
echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Squiz.PHP.NonExecutableCode.ReturnNotRequired'
echo 'Messages:Array
(
[0] => Empty return statement not required here
)
'
echo 'Lines:Array
(
[0] => CRM/Contact/BAO/SavedSearch.php:258
)
'
echo ''
echo 'Total number of edits to perform: 1'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Contact/BAO/SavedSearch.php' 258
echo '==============================================================='
echo ''
echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.Commenting.FunctionComment.SpacingAfter'
echo 'Messages:Array
(
[0] => There must be no blank lines after the function comment
)
'
echo 'Lines:Array
(
[0] => CRM/Case/PseudoConstant.php:108
[1] => CRM/Member/BAO/MembershipLog.php:64
[2] => CRM/Mailing/Form/Browse.php:73
[3] => CRM/Core/Config/Defaults.php:80
)
'
echo ''
echo 'Total number of edits to perform: 4'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Case/PseudoConstant.php' 108
edit_at_line 'CRM/Member/BAO/MembershipLog.php' 64
edit_at_line 'CRM/Mailing/Form/Browse.php' 73
edit_at_line 'CRM/Core/Config/Defaults.php' 80
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 10 spaces, found 8
[1] => Line indented incorrectly; expected 6 spaces, found 8
[2] => Line indented incorrectly; expected 8 spaces, found 10
)
'
echo 'Lines:Array
(
[0] => CRM/Core/Region.php:201
[1] => CRM/Core/ManagedEntities.php:48
[2] => CRM/Extension/Manager.php:355
)
'
echo ''
echo 'Total number of edits to perform: 3'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Core/Region.php' 201
edit_at_line 'CRM/Core/ManagedEntities.php' 48
edit_at_line 'CRM/Extension/Manager.php' 355
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch'
echo 'Messages:Array
(
[0] => Doc comment for parameter $printShould does not match actual variable name $outputHeader
[1] => Doc comment for parameter $requestArgs does not match actual variable name $absolute
)
'
echo 'Lines:Array
(
[0] => CRM/Core/Report/Excel.php:46
[1] => CRM/Core/Page/Redirect.php:28
)
'
echo ''
echo 'Total number of edits to perform: 2'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Core/Report/Excel.php' 46
edit_at_line 'CRM/Core/Page/Redirect.php' 28
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.WhiteSpace.OperatorSpacing.NoSpaceAfter'
echo 'Messages:Array
(
[0] => Expected 1 space after \"+\"; 0 found
)
'
echo 'Lines:Array
(
[0] => CRM/Event/Page/EventInfo.php:198
)
'
echo ''
echo 'Total number of edits to perform: 1'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Event/Page/EventInfo.php' 198
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.WhiteSpace.OperatorSpacing.NoSpaceAfter!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Squiz.WhiteSpace.SemicolonSpacing.Incorrect'
echo 'Messages:Array
(
[0] => Space found before semicolon; expected \"};\" but found \"}
;\"
)
'
echo 'Lines:Array
(
[0] => CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php:112
[1] => CRM/Dedupe/BAO/QueryBuilder.php:27
[2] => CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php:59
)
'
echo ''
echo 'Total number of edits to perform: 3'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php' 112
edit_at_line 'CRM/Dedupe/BAO/QueryBuilder.php' 27
edit_at_line 'CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php' 59
echo '==============================================================='
echo ''
echo 'Completed formatting issue Squiz.WhiteSpace.SemicolonSpacing.Incorrect!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.Semantics.Br.XHTMLBr'
echo 'Messages:Array
(
[0] => Use XHTML style
tags instead of
)
'
echo 'Lines:Array
(
[0] => CRM/Dashlet/Page/Blog.php:120
)
'
echo ''
echo 'Total number of edits to perform: 1'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Dashlet/Page/Blog.php' 120
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Semantics.Br.XHTMLBr!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.Formatting.SpaceInlineIf.SpacingBefore'
echo 'Messages:Array
(
[0] => Expected 1 space before \"?\"; newline found
)
'
echo 'Lines:Array
(
[0] => CRM/Mailing/Event/BAO/Bounce.php:270
)
'
echo ''
echo 'Total number of edits to perform: 1'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Mailing/Event/BAO/Bounce.php' 270
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Formatting.SpaceInlineIf.SpacingBefore!'
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/Event/Cart/BAO/Cart.php:104
[1] => CRM/Event/Cart/BAO/EventInCart.php:29
)
'
echo ''
echo 'Total number of edits to perform: 2'
if ask_continue 'Edit these files?'; then
edit_at_line 'CRM/Event/Cart/BAO/Cart.php' 104
edit_at_line 'CRM/Event/Cart/BAO/EventInCart.php' 29
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.FunctionComment.$InReturnType!'
echo ''
echo 'Yay!'
echo ''
fi
echo '==============================================================='
echo 'Formatting issue: Drupal.Commenting.FunctionComment.ReturnCommentIndentation'
echo 'Messages:Array
(
[0] => Return comment indentation must be 3 spaces, found 1 spaces
)
'
echo 'Lines:Array
(
[0] => api/v3/ParticipantPayment.php:52
)
'
echo ''
echo 'Total number of edits to perform: 1'
if ask_continue 'Edit these files?'; then
edit_at_line 'api/v3/ParticipantPayment.php' 52
echo '==============================================================='
echo ''
echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!'
echo ''
echo 'Yay!'
echo ''
fi