#!/bin/bash ## usage: bash batch-13.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] => api/v3/Generic/Setvalue.php:25 [1] => api/v3/Generic/Setvalue.php:71 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Generic/Setvalue.php' 25 edit_at_line 'api/v3/Generic/Setvalue.php' 71 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' 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/Generic/Setvalue.php:70 [1] => CRM/Logging/ReportSummary.php:192 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Generic/Setvalue.php' 70 edit_at_line 'api/v3/Generic/Setvalue.php' 70 edit_at_line 'CRM/Logging/ReportSummary.php' 192 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.NoSpace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Generic.PHP.UpperCaseConstant.Found' echo 'Messages:Array ( [0] => TRUE, FALSE and NULL must be uppercase; expected \"FALSE\" but found \"false\" ) ' echo 'Lines:Array ( [0] => api/v3/Generic/Setvalue.php:70 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Generic/Setvalue.php' 70 echo '===============================================================' echo '' echo 'Completed formatting issue Generic.PHP.UpperCaseConstant.Found!' 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/Email.php:49 [1] => api/v3/Email.php:78 [2] => api/v3/Email.php:97 [3] => api/v3/GroupNesting.php:63 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Email.php' 49 edit_at_line 'api/v3/Email.php' 78 edit_at_line 'api/v3/Email.php' 97 edit_at_line 'api/v3/GroupNesting.php' 63 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 ) ' echo 'Lines:Array ( [0] => api/v3/Email.php:76 [1] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php:527 [2] => CRM/Core/Payment/PayPalImpl.php:429 [3] => CRM/Utils/File.php:47 [4] => CRM/Utils/File.php:75 [5] => CRM/Utils/File.php:206 [6] => CRM/Utils/File.php:351 [7] => CRM/Contact/BAO/Contact/Utils.php:225 [8] => CRM/Utils/Mail.php:58 [9] => CRM/Utils/Mail.php:277 [10] => CRM/Utils/Mail/EmailProcessor.php:49 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Email.php' 76 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php' 527 edit_at_line 'CRM/Core/Payment/PayPalImpl.php' 429 edit_at_line 'CRM/Utils/File.php' 47 edit_at_line 'CRM/Utils/File.php' 75 edit_at_line 'CRM/Utils/File.php' 206 edit_at_line 'CRM/Utils/File.php' 351 edit_at_line 'CRM/Contact/BAO/Contact/Utils.php' 225 edit_at_line 'CRM/Utils/Mail.php' 58 edit_at_line 'CRM/Utils/Mail.php' 277 edit_at_line 'CRM/Utils/Mail/EmailProcessor.php' 49 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => api/v3/Email.php:87 [1] => CRM/PCP/Form/PCP.php:46 [2] => CRM/PCP/Form/PCP.php:125 [3] => CRM/PCP/Form/PCP.php:142 [4] => CRM/PCP/Form/PCP.php:207 [5] => CRM/Contact/Form/Task/Label.php:96 [6] => CRM/Price/Form/Field.php:75 [7] => CRM/Price/Form/Field.php:101 [8] => CRM/Price/Form/Field.php:170 [9] => CRM/Price/Form/Field.php:608 [10] => CRM/Price/Page/Option.php:79 [11] => CRM/Price/Page/Option.php:123 [12] => CRM/Price/Page/Option.php:258 [13] => CRM/Contact/Import/Parser.php:408 [14] => CRM/Core/State.php:111 [15] => CRM/Core/State.php:129 [16] => CRM/Core/State.php:164 [17] => CRM/Core/State.php:176 [18] => CRM/Core/State.php:196 [19] => CRM/Core/BAO/CustomQuery.php:259 [20] => CRM/Core/BAO/CustomQuery.php:326 [21] => CRM/Core/BAO/CustomQuery.php:558 ) ' echo '' echo 'Total number of edits to perform: 22' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Email.php' 87 edit_at_line 'CRM/PCP/Form/PCP.php' 46 edit_at_line 'CRM/PCP/Form/PCP.php' 125 edit_at_line 'CRM/PCP/Form/PCP.php' 142 edit_at_line 'CRM/PCP/Form/PCP.php' 207 edit_at_line 'CRM/Contact/Form/Task/Label.php' 96 edit_at_line 'CRM/Price/Form/Field.php' 75 edit_at_line 'CRM/Price/Form/Field.php' 101 edit_at_line 'CRM/Price/Form/Field.php' 170 edit_at_line 'CRM/Price/Form/Field.php' 608 edit_at_line 'CRM/Price/Page/Option.php' 79 edit_at_line 'CRM/Price/Page/Option.php' 123 edit_at_line 'CRM/Price/Page/Option.php' 258 edit_at_line 'CRM/Contact/Import/Parser.php' 408 edit_at_line 'CRM/Core/State.php' 111 edit_at_line 'CRM/Core/State.php' 129 edit_at_line 'CRM/Core/State.php' 164 edit_at_line 'CRM/Core/State.php' 176 edit_at_line 'CRM/Core/State.php' 196 edit_at_line 'CRM/Core/BAO/CustomQuery.php' 259 edit_at_line 'CRM/Core/BAO/CustomQuery.php' 326 edit_at_line 'CRM/Core/BAO/CustomQuery.php' 558 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Formatting.SpaceUnaryOperator.BooleanNot' echo 'Messages:Array ( [0] => A unary operator statement must not be followed by a space ) ' echo 'Lines:Array ( [0] => api/v3/Extension.php:183 [1] => api/v3/Extension.php:187 [2] => api/v3/Extension.php:188 [3] => api/v3/Extension.php:202 [4] => api/v3/Extension.php:210 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Extension.php' 183 edit_at_line 'api/v3/Extension.php' 187 edit_at_line 'api/v3/Extension.php' 188 edit_at_line 'api/v3/Extension.php' 202 edit_at_line 'api/v3/Extension.php' 210 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.SpaceUnaryOperator.BooleanNot!' 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/Upgrade/Snapshot/V4p2/Price/BAO/Field.php:281 [1] => CRM/Member/Page/Tab.php:160 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php' 281 edit_at_line 'CRM/Member/Page/Tab.php' 160 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace!' 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: '\''Mr. Anthony Anderson II'\'' [2] => A comma should follow the last multiline array item. Found: '\''openid'\'' [3] => A comma should follow the last multiline array item. Found: $sharedAddressCount [4] => A comma should follow the last multiline array item. Found: $deleted [5] => A comma should follow the last multiline array item. Found: '\'' '\'' [6] => A comma should follow the last multiline array item. Found: '\''edit'\'' [7] => A comma should follow the last multiline array item. Found: '\''street_address'\'' [8] => A comma should follow the last multiline array item. Found: '\''SMTP'\'' [9] => A comma should follow the last multiline array item. Found: '\''contribution_amount_high'\'' [10] => A comma should follow the last multiline array item. Found: '\''case_tags'\'' [11] => A comma should follow the last multiline array item. Found: '\''participant_role_id'\'' [12] => A comma should follow the last multiline array item. Found: $optionGroupID [13] => A comma should follow the last multiline array item. Found: '\''For Contacts'\'' [14] => A comma should follow the last multiline array item. Found: '\''For Activities'\'' [15] => A comma should follow the last multiline array item. Found: '\''READONLY'\'' [16] => A comma should follow the last multiline array item. Found: $creditURL [17] => A comma should follow the last multiline array item. Found: 3 [18] => A comma should follow the last multiline array item. Found: $max_related [19] => A comma should follow the last multiline array item. Found: '\''description'\'' [20] => A comma should follow the last multiline array item. Found: '\''county'\'' [21] => A comma should follow the last multiline array item. Found: \"]\" [22] => A comma should follow the last multiline array item. Found: '\''phone'\'' [23] => A comma should follow the last multiline array item. Found: '\''banana'\'' [24] => A comma should follow the last multiline array item. Found: '\''search'\'' [25] => A comma should follow the last multiline array item. Found: '\''monthDate'\'' ) ' echo 'Lines:Array ( [0] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php:413 [1] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php:513 [2] => tests/phpunit/CRM/Core/Payment/BaseIPNTest.php:227 [3] => CRM/Contact/Form/Task/Label.php:70 [4] => CRM/Contact/Form/Task/Label.php:294 [5] => CRM/Group/Form/Edit.php:98 [6] => CRM/Contact/Form/Task/Delete.php:131 [7] => CRM/Contact/Form/Task/Delete.php:138 [8] => CRM/Contact/Form/Task/Delete.php:261 [9] => CRM/Contact/Form/Task/Delete.php:268 [10] => CRM/Contact/Form/Task/Delete.php:275 [11] => CRM/Price/Form/Field.php:295 [12] => CRM/Contact/BAO/Contact/Utils.php:609 [13] => CRM/Contact/BAO/Contact/Utils.php:727 [14] => CRM/Utils/Mail.php:203 [15] => CRM/Utils/Mail.php:214 [16] => CRM/Contact/Form/Search/Advanced.php:250 [17] => CRM/Contact/Form/Search/Advanced.php:286 [18] => CRM/Contact/Form/Search/Advanced.php:377 [19] => tests/phpunit/api/v3/CustomFieldTest.php:245 [20] => tests/phpunit/api/v3/CustomFieldTest.php:249 [21] => tests/phpunit/api/v3/CustomFieldTest.php:454 [22] => tests/phpunit/api/v3/CustomFieldTest.php:461 [23] => CRM/Pledge/Form/Pledge.php:240 [24] => CRM/Pledge/Form/Pledge.php:336 [25] => CRM/Pledge/Form/Pledge.php:358 [26] => CRM/Pledge/Form/Pledge.php:409 [27] => CRM/Pledge/Form/Pledge.php:640 [28] => CRM/Price/Page/Option.php:283 [29] => CRM/Financial/Form/FinancialTypeAccount.php:174 [30] => CRM/Financial/Form/FinancialTypeAccount.php:196 [31] => CRM/Financial/Form/FinancialTypeAccount.php:226 [32] => CRM/Member/Page/Tab.php:171 [33] => CRM/Core/OptionGroup.php:629 [34] => CRM/Core/Page/AJAX/Location.php:232 [35] => CRM/Core/Page/AJAX/Location.php:238 [36] => CRM/Core/Page/AJAX/Location.php:251 [37] => CRM/Core/Page/AJAX/Location.php:259 [38] => CRM/Core/Page/AJAX/Location.php:269 [39] => tests/phpunit/CRM/Core/ResourcesTest.php:125 [40] => tests/phpunit/CRM/Core/ResourcesTest.php:126 [41] => tests/phpunit/CRM/Core/ResourcesTest.php:127 [42] => tests/phpunit/CRM/Core/ResourcesTest.php:128 [43] => CRM/Core/BAO/CustomQuery.php:360 [44] => CRM/Contribute/Page/DashBoard.php:60 [45] => CRM/SMS/Page/Provider.php:114 ) ' echo '' echo 'Total number of edits to perform: 46' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php' 413 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php' 513 edit_at_line 'tests/phpunit/CRM/Core/Payment/BaseIPNTest.php' 227 edit_at_line 'CRM/Contact/Form/Task/Label.php' 70 edit_at_line 'CRM/Contact/Form/Task/Label.php' 294 edit_at_line 'CRM/Group/Form/Edit.php' 98 edit_at_line 'CRM/Contact/Form/Task/Delete.php' 131 edit_at_line 'CRM/Contact/Form/Task/Delete.php' 138 edit_at_line 'CRM/Contact/Form/Task/Delete.php' 261 edit_at_line 'CRM/Contact/Form/Task/Delete.php' 268 edit_at_line 'CRM/Contact/Form/Task/Delete.php' 275 edit_at_line 'CRM/Price/Form/Field.php' 295 edit_at_line 'CRM/Contact/BAO/Contact/Utils.php' 609 edit_at_line 'CRM/Contact/BAO/Contact/Utils.php' 727 edit_at_line 'CRM/Utils/Mail.php' 203 edit_at_line 'CRM/Utils/Mail.php' 214 edit_at_line 'CRM/Contact/Form/Search/Advanced.php' 250 edit_at_line 'CRM/Contact/Form/Search/Advanced.php' 286 edit_at_line 'CRM/Contact/Form/Search/Advanced.php' 377 edit_at_line 'tests/phpunit/api/v3/CustomFieldTest.php' 245 edit_at_line 'tests/phpunit/api/v3/CustomFieldTest.php' 249 edit_at_line 'tests/phpunit/api/v3/CustomFieldTest.php' 454 edit_at_line 'tests/phpunit/api/v3/CustomFieldTest.php' 461 edit_at_line 'CRM/Pledge/Form/Pledge.php' 240 edit_at_line 'CRM/Pledge/Form/Pledge.php' 336 edit_at_line 'CRM/Pledge/Form/Pledge.php' 358 edit_at_line 'CRM/Pledge/Form/Pledge.php' 409 edit_at_line 'CRM/Pledge/Form/Pledge.php' 640 edit_at_line 'CRM/Price/Page/Option.php' 283 edit_at_line 'CRM/Financial/Form/FinancialTypeAccount.php' 174 edit_at_line 'CRM/Financial/Form/FinancialTypeAccount.php' 196 edit_at_line 'CRM/Financial/Form/FinancialTypeAccount.php' 226 edit_at_line 'CRM/Member/Page/Tab.php' 171 edit_at_line 'CRM/Core/OptionGroup.php' 629 edit_at_line 'CRM/Core/Page/AJAX/Location.php' 232 edit_at_line 'CRM/Core/Page/AJAX/Location.php' 238 edit_at_line 'CRM/Core/Page/AJAX/Location.php' 251 edit_at_line 'CRM/Core/Page/AJAX/Location.php' 259 edit_at_line 'CRM/Core/Page/AJAX/Location.php' 269 edit_at_line 'tests/phpunit/CRM/Core/ResourcesTest.php' 125 edit_at_line 'tests/phpunit/CRM/Core/ResourcesTest.php' 126 edit_at_line 'tests/phpunit/CRM/Core/ResourcesTest.php' 127 edit_at_line 'tests/phpunit/CRM/Core/ResourcesTest.php' 128 edit_at_line 'CRM/Core/BAO/CustomQuery.php' 360 edit_at_line 'CRM/Contribute/Page/DashBoard.php' 60 edit_at_line 'CRM/SMS/Page/Provider.php' 114 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/Upgrade/Snapshot/V4p2/Price/BAO/Field.php:577 [1] => tests/phpunit/api/v3/ContactTest.php:1027 [2] => tests/phpunit/CRM/Core/ResourcesTest.php:85 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php' 577 edit_at_line 'tests/phpunit/api/v3/ContactTest.php' 1027 edit_at_line 'tests/phpunit/CRM/Core/ResourcesTest.php' 85 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' 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] => tests/phpunit/CRM/Core/Payment/BaseIPNTest.php:293 [1] => tests/phpunit/CRM/Core/Payment/BaseIPNTest.php:439 [2] => CRM/Logging/ReportSummary.php:388 [3] => CRM/Contact/Form/Task/Label.php:65 [4] => CRM/Contact/BAO/Contact/Utils.php:335 [5] => CRM/Contact/BAO/Group.php:1224 [6] => CRM/Contact/Form/Search/Advanced.php:273 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Core/Payment/BaseIPNTest.php' 293 edit_at_line 'tests/phpunit/CRM/Core/Payment/BaseIPNTest.php' 439 edit_at_line 'CRM/Logging/ReportSummary.php' 388 edit_at_line 'CRM/Contact/Form/Task/Label.php' 65 edit_at_line 'CRM/Contact/BAO/Contact/Utils.php' 335 edit_at_line 'CRM/Contact/BAO/Group.php' 1224 edit_at_line 'CRM/Contact/Form/Search/Advanced.php' 273 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.IncorrectExact' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 2 spaces, found 0 ) ' echo 'Lines:Array ( [0] => tests/phpunit/CRM/Core/Payment/BaseIPNTest.php:433 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Core/Payment/BaseIPNTest.php' 433 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!' 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/Core/Payment/BaseIPNTest.php:438 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Core/Payment/BaseIPNTest.php' 438 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' 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/Core/Payment/PayPalImpl.php:251 [1] => CRM/Core/Payment/PayPalImpl.php:338 [2] => CRM/Core/Payment/PayPalImpl.php:346 [3] => CRM/Logging/ReportSummary.php:59 [4] => CRM/Logging/ReportSummary.php:190 [5] => CRM/Group/Form/Edit.php:143 [6] => CRM/Group/Form/Edit.php:148 [7] => CRM/Utils/Mail.php:94 [8] => CRM/Utils/Mail/EmailProcessor.php:146 [9] => tests/phpunit/CRM/Member/BAO/MembershipTest.php:525 [10] => CRM/Batch/Page/AJAX.php:68 [11] => CRM/Batch/Page/AJAX.php:70 [12] => CRM/Batch/Page/AJAX.php:72 [13] => CRM/Batch/Page/AJAX.php:74 [14] => CRM/Batch/Page/AJAX.php:76 ) ' echo '' echo 'Total number of edits to perform: 15' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/PayPalImpl.php' 251 edit_at_line 'CRM/Core/Payment/PayPalImpl.php' 338 edit_at_line 'CRM/Core/Payment/PayPalImpl.php' 346 edit_at_line 'CRM/Logging/ReportSummary.php' 59 edit_at_line 'CRM/Logging/ReportSummary.php' 190 edit_at_line 'CRM/Group/Form/Edit.php' 143 edit_at_line 'CRM/Group/Form/Edit.php' 148 edit_at_line 'CRM/Utils/Mail.php' 94 edit_at_line 'CRM/Utils/Mail/EmailProcessor.php' 146 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTest.php' 525 edit_at_line 'CRM/Batch/Page/AJAX.php' 68 edit_at_line 'CRM/Batch/Page/AJAX.php' 70 edit_at_line 'CRM/Batch/Page/AJAX.php' 72 edit_at_line 'CRM/Batch/Page/AJAX.php' 74 edit_at_line 'CRM/Batch/Page/AJAX.php' 76 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' 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/Core/Payment/PayPalImpl.php:777 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/PayPalImpl.php' 777 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.ContentAfterOpen!' 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/PCP/Form/PCP.php:198 [1] => CRM/Contact/Form/Task/Label.php:395 [2] => CRM/Contact/BAO/Group.php:76 [3] => CRM/Member/Page/Tab.php:51 [4] => CRM/Member/Page/Tab.php:582 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/PCP/Form/PCP.php' 198 edit_at_line 'CRM/Contact/Form/Task/Label.php' 395 edit_at_line 'CRM/Contact/BAO/Group.php' 76 edit_at_line 'CRM/Member/Page/Tab.php' 51 edit_at_line 'CRM/Member/Page/Tab.php' 582 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.HookComment' echo 'Messages:Array ( [0] => Format should be \"* Implements hook_foo().\", \"* Implements hook_foo_BAR_ID_bar() for xyz_bar().\",, \"* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.\", or \"* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.\". ) ' echo 'Lines:Array ( [0] => tests/extensions/test.extension.manager.moduletest/moduletest.php:4 [1] => tests/extensions/test.extension.manager.moduletest/moduletest.php:11 [2] => tests/extensions/test.extension.manager.moduletest/moduletest.php:18 [3] => tests/extensions/test.extension.manager.moduletest/moduletest.php:25 [4] => tests/extensions/test.extension.manager.moduletest/moduletest.php:32 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'tests/extensions/test.extension.manager.moduletest/moduletest.php' 4 edit_at_line 'tests/extensions/test.extension.manager.moduletest/moduletest.php' 11 edit_at_line 'tests/extensions/test.extension.manager.moduletest/moduletest.php' 18 edit_at_line 'tests/extensions/test.extension.manager.moduletest/moduletest.php' 25 edit_at_line 'tests/extensions/test.extension.manager.moduletest/moduletest.php' 32 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.HookComment!' 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/Logging/ReportSummary.php:176 [1] => CRM/Utils/Mail/EmailProcessor.php:54 [2] => CRM/Utils/Mail/EmailProcessor.php:104 [3] => CRM/Utils/Mail/EmailProcessor.php:127 [4] => tests/phpunit/CRM/Member/BAO/MembershipTest.php:522 [5] => tests/phpunit/CRM/Member/BAO/MembershipTest.php:523 [6] => tests/phpunit/CRM/Member/BAO/MembershipTest.php:604 [7] => tests/phpunit/CRM/Member/BAO/MembershipTest.php:605 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Logging/ReportSummary.php' 176 edit_at_line 'CRM/Utils/Mail/EmailProcessor.php' 54 edit_at_line 'CRM/Utils/Mail/EmailProcessor.php' 104 edit_at_line 'CRM/Utils/Mail/EmailProcessor.php' 127 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTest.php' 522 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTest.php' 523 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTest.php' 604 edit_at_line 'tests/phpunit/CRM/Member/BAO/MembershipTest.php' 605 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 10 spaces but found 12 [1] => Array indentation error, expected 12 spaces but found 14 ) ' echo 'Lines:Array ( [0] => CRM/Group/Form/Edit.php:130 [1] => CRM/Group/Form/Edit.php:288 [2] => CRM/Contact/Import/Parser.php:558 [3] => CRM/Contact/Import/Parser.php:560 [4] => CRM/Financial/Form/FinancialTypeAccount.php:184 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Group/Form/Edit.php' 130 edit_at_line 'CRM/Group/Form/Edit.php' 288 edit_at_line 'CRM/Contact/Import/Parser.php' 558 edit_at_line 'CRM/Contact/Import/Parser.php' 560 edit_at_line 'CRM/Financial/Form/FinancialTypeAccount.php' 184 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"copyDir\" [1] => Visibility must be declared on method \"getGroups\" [2] => Visibility must be declared on method \"getGroupsHierarchy\" [3] => Visibility must be declared on method \"actionLinks\" [4] => Visibility must be declared on method \"run\" [5] => Visibility must be declared on method \"addField\" [6] => Visibility must be declared on method \"links\" [7] => Visibility must be declared on method \"valuesCommon\" [8] => Visibility must be declared on method \"values\" [9] => Visibility must be declared on method \"getValue\" [10] => Visibility must be declared on method \"getRowValues\" [11] => Visibility must be declared on method \"tables\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/File.php:183 [1] => CRM/Contact/BAO/Group.php:241 [2] => CRM/Contact/BAO/Group.php:995 [3] => CRM/Price/Page/Option.php:84 [4] => CRM/Contact/Import/Parser.php:104 [5] => CRM/Contact/Import/Parser.php:656 [6] => CRM/Member/Page/Tab.php:468 [7] => CRM/Core/OptionGroup.php:57 [8] => CRM/Core/OptionGroup.php:118 [9] => CRM/Core/OptionGroup.php:377 [10] => CRM/Core/OptionGroup.php:597 [11] => CRM/Core/I18n/SchemaStructure_3_0_alpha1.php:243 ) ' echo '' echo 'Total number of edits to perform: 12' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/File.php' 183 edit_at_line 'CRM/Contact/BAO/Group.php' 241 edit_at_line 'CRM/Contact/BAO/Group.php' 995 edit_at_line 'CRM/Price/Page/Option.php' 84 edit_at_line 'CRM/Contact/Import/Parser.php' 104 edit_at_line 'CRM/Contact/Import/Parser.php' 656 edit_at_line 'CRM/Member/Page/Tab.php' 468 edit_at_line 'CRM/Core/OptionGroup.php' 57 edit_at_line 'CRM/Core/OptionGroup.php' 118 edit_at_line 'CRM/Core/OptionGroup.php' 377 edit_at_line 'CRM/Core/OptionGroup.php' 597 edit_at_line 'CRM/Core/I18n/SchemaStructure_3_0_alpha1.php' 243 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturnNotVoid' echo 'Messages:Array ( [0] => Function return type is not void, but function is returning void here ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/Contact/Utils.php:1088 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/Contact/Utils.php' 1088 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' 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/Group.php:521 [1] => CRM/Contact/Form/Search/Advanced.php:411 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/Group.php' 521 edit_at_line 'CRM/Contact/Form/Search/Advanced.php' 411 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar' echo 'Messages:Array ( [0] => Expected 3 space(s) before asterisk; 4 found ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/ContactTest.php:1689 [1] => tests/phpunit/api/v3/ContactTest.php:1690 [2] => tests/phpunit/api/v3/ContactTest.php:1704 [3] => tests/phpunit/api/v3/ContactTest.php:1705 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/ContactTest.php' 1689 edit_at_line 'tests/phpunit/api/v3/ContactTest.php' 1690 edit_at_line 'tests/phpunit/api/v3/ContactTest.php' 1704 edit_at_line 'tests/phpunit/api/v3/ContactTest.php' 1705 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar!' 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/api/v3/CustomFieldTest.php:135 [1] => CRM/Report/Page/InstanceList.php:49 [2] => CRM/Report/Page/InstanceList.php:56 [3] => CRM/Report/Page/InstanceList.php:63 [4] => CRM/Report/Page/InstanceList.php:70 [5] => CRM/Report/Page/InstanceList.php:78 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/CustomFieldTest.php' 135 edit_at_line 'CRM/Report/Page/InstanceList.php' 49 edit_at_line 'CRM/Report/Page/InstanceList.php' 56 edit_at_line 'CRM/Report/Page/InstanceList.php' 63 edit_at_line 'CRM/Report/Page/InstanceList.php' 70 edit_at_line 'CRM/Report/Page/InstanceList.php' 78 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayClosingIndentation' echo 'Messages:Array ( [0] => Array closing indentation error, expected 8 spaces but found 10 ) ' echo 'Lines:Array ( [0] => CRM/Financial/Form/FinancialTypeAccount.php:185 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Financial/Form/FinancialTypeAccount.php' 185 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' 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/Contribute/Form/Task/PDFLetterCommon.php:147 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/Task/PDFLetterCommon.php' 147 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SemicolonSpacing.Incorrect!' echo '' echo 'Yay!' echo '' fi