#!/bin/bash ## usage: bash batch-6.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.Classes.ClassCreateInstance' echo 'Messages:Array ( [0] => Calling class constructors must always include parentheses ) ' echo 'Lines:Array ( [0] => tests/phpunit/CRM/Member/Form/MembershipTest.php:225 [1] => tests/phpunit/CRM/Member/Form/MembershipTest.php:261 [2] => tests/phpunit/CRM/Member/Form/MembershipTest.php:290 [3] => tests/phpunit/CRM/Member/Form/MembershipTest.php:317 [4] => tests/phpunit/CRM/Member/Form/MembershipTest.php:343 [5] => tests/phpunit/CRM/Member/Form/MembershipTest.php:362 [6] => tests/phpunit/CRM/Member/Form/MembershipTest.php:386 [7] => tests/phpunit/CRM/Member/Form/MembershipTest.php:411 [8] => tests/phpunit/CRM/Member/Form/MembershipTest.php:432 [9] => tests/phpunit/CRM/Member/Form/MembershipTest.php:453 [10] => tests/phpunit/CRM/Member/Form/MembershipTest.php:474 [11] => tests/phpunit/CRM/Member/Form/MembershipTest.php:495 [12] => tests/phpunit/CRM/Member/Form/MembershipTest.php:516 [13] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1217 [14] => CRM/Contribute/BAO/Contribution.php:1583 [15] => CRM/Event/Page/ManageEvent.php:305 [16] => CRM/Event/Form/Participant.php:860 [17] => CRM/Event/Form/Participant.php:910 ) ' echo '' echo 'Total number of edits to perform: 18' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 225 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 261 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 290 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 317 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 343 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 362 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 386 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 411 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 432 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 453 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 474 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 495 edit_at_line 'tests/phpunit/CRM/Member/Form/MembershipTest.php' 516 edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1217 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 1583 edit_at_line 'CRM/Event/Page/ManageEvent.php' 305 edit_at_line 'CRM/Event/Form/Participant.php' 860 edit_at_line 'CRM/Event/Form/Participant.php' 910 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 8 spaces but found 0 [1] => Array indentation error, expected 6 spaces but found 8 [2] => Array indentation error, expected 8 spaces but found 10 [3] => Array indentation error, expected 10 spaces but found 12 [4] => Array indentation error, expected 12 spaces but found 14 ) ' echo 'Lines:Array ( [0] => CRM/Event/Form/ManageEvent/Registration.php:252 [1] => CRM/Event/Form/ManageEvent/Registration.php:253 [2] => CRM/Event/Form/ManageEvent/Registration.php:254 [3] => CRM/Event/Form/ManageEvent/Registration.php:255 [4] => CRM/Event/Form/ManageEvent/Registration.php:256 [5] => CRM/Report/Form/Contribute/Lybunt.php:73 [6] => CRM/Report/Form/Contribute/Lybunt.php:101 [7] => CRM/Report/Form/Contribute/Lybunt.php:102 [8] => CRM/Report/Form/Contribute/Lybunt.php:111 [9] => CRM/Report/Form/Contribute/Lybunt.php:112 [10] => CRM/Report/Form/Contribute/Lybunt.php:121 [11] => CRM/Contribute/BAO/Contribution.php:650 [12] => CRM/Contribute/BAO/Contribution.php:654 [13] => CRM/Campaign/Form/Task/Interview.php:435 [14] => CRM/Campaign/Form/Task/Interview.php:438 [15] => CRM/Report/Form/Pledge/Detail.php:72 [16] => CRM/Report/Form/Pledge/Detail.php:86 [17] => CRM/Report/Form/Pledge/Detail.php:87 [18] => CRM/Report/Form/Pledge/Detail.php:93 [19] => CRM/Report/Form/Pledge/Detail.php:94 [20] => CRM/Report/Form/Pledge/Detail.php:160 [21] => CRM/Report/Form/Pledge/Detail.php:161 [22] => CRM/Report/Form/Pledge/Detail.php:175 [23] => CRM/Core/BAO/ActionSchedule.php:917 [24] => CRM/Event/Form/Participant.php:707 ) ' echo '' echo 'Total number of edits to perform: 25' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 252 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 253 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 254 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 255 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 256 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 73 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 101 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 102 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 111 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 112 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 121 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 650 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 654 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 435 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 438 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 72 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 86 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 87 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 93 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 94 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 160 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 161 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 175 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 917 edit_at_line 'CRM/Event/Form/Participant.php' 707 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.DocComment.WrongEnd' echo 'Messages:Array ( [0] => Wrong function doc comment end; expected \"*/\", found \"**/\" ) ' echo 'Lines:Array ( [0] => CRM/Event/Form/ManageEvent/Registration.php:357 [1] => CRM/Event/Form/ManageEvent/Registration.php:370 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 357 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 370 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' 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: '\''Individual'\'' [1] => A comma should follow the last multiline array item. Found: '\''*'\'' [2] => A comma should follow the last multiline array item. Found: 5 [3] => A comma should follow the last multiline array item. Found: 1 [4] => A comma should follow the last multiline array item. Found: _profileID [5] => A comma should follow the last multiline array item. Found: '\''all'\'' [6] => A comma should follow the last multiline array item. Found: '\''financial_type'\'' [7] => A comma should follow the last multiline array item. Found: '\''membership_batch_entry'\'' [8] => A comma should follow the last multiline array item. Found: '\''validate'\'' [9] => A comma should follow the last multiline array item. Found: '\''address'\'' [10] => A comma should follow the last multiline array item. Found: '\''Contact'\'' [11] => A comma should follow the last multiline array item. Found: T_STRING [12] => A comma should follow the last multiline array item. Found: '\''interviewerId'\'' [13] => A comma should follow the last multiline array item. Found: '\''Descending'\'' [14] => A comma should follow the last multiline array item. Found: ) [15] => A comma should follow the last multiline array item. Found: '\''sms_text'\'' [16] => A comma should follow the last multiline array item. Found: $messageSubject [17] => A comma should follow the last multiline array item. Found: '\''balance'\'' [18] => A comma should follow the last multiline array item. Found: '\''Integer'\'' [19] => A comma should follow the last multiline array item. Found: $defaultLocation [20] => A comma should follow the last multiline array item. Found: '\''state_province'\'' [21] => A comma should follow the last multiline array item. Found: '\''Activity'\'' [22] => A comma should follow the last multiline array item. Found: '\''Case'\'' [23] => A comma should follow the last multiline array item. Found: $profileType [24] => A comma should follow the last multiline array item. Found: '\''civicrm/admin/participant_status'\'' [25] => A comma should follow the last multiline array item. Found: $eventTitle [26] => A comma should follow the last multiline array item. Found: $userName ) ' echo 'Lines:Array ( [0] => CRM/Event/Form/ManageEvent/Registration.php:380 [1] => CRM/Event/Form/ManageEvent/Registration.php:396 [2] => tests/phpunit/api/v3/ProfileTest.php:179 [3] => tests/phpunit/api/v3/ProfileTest.php:185 [4] => tests/phpunit/api/v3/ProfileTest.php:312 [5] => tests/phpunit/api/v3/ProfileTest.php:330 [6] => tests/phpunit/api/v3/ProfileTest.php:346 [7] => tests/phpunit/api/v3/ProfileTest.php:354 [8] => tests/phpunit/api/v3/ProfileTest.php:371 [9] => tests/phpunit/api/v3/ProfileTest.php:478 [10] => tests/phpunit/api/v3/ProfileTest.php:482 [11] => tests/phpunit/api/v3/ProfileTest.php:495 [12] => tests/phpunit/api/v3/ProfileTest.php:719 [13] => tests/phpunit/api/v3/ProfileTest.php:936 [14] => CRM/Contribute/BAO/Contribution.php:645 [15] => CRM/Campaign/Form/Task/Interview.php:84 [16] => CRM/Campaign/Form/Task/Interview.php:303 [17] => CRM/Campaign/Form/Task/Interview.php:324 [18] => CRM/Campaign/Form/Task/Interview.php:353 [19] => CRM/Campaign/Form/Task/Interview.php:461 [20] => CRM/Event/Page/ManageEvent.php:217 [21] => CRM/Core/BAO/ActionSchedule.php:492 [22] => CRM/Core/BAO/ActionSchedule.php:532 [23] => CRM/Core/BAO/ActionSchedule.php:756 [24] => CRM/Core/BAO/ActionSchedule.php:1336 [25] => CRM/Core/BAO/ActionSchedule.php:1337 [26] => CRM/UF/Form/Field.php:114 [27] => CRM/UF/Form/Field.php:297 [28] => CRM/UF/Form/Field.php:565 [29] => CRM/UF/Form/Field.php:634 [30] => CRM/UF/Form/Field.php:690 [31] => CRM/UF/Form/Field.php:799 [32] => CRM/UF/Form/Field.php:991 [33] => CRM/UF/Form/Field.php:1003 [34] => CRM/Event/Form/Participant.php:293 [35] => CRM/Event/Form/Participant.php:646 [36] => CRM/Event/Form/Participant.php:745 [37] => CRM/Event/Form/Participant.php:1092 [38] => CRM/Event/Form/Participant.php:1325 [39] => CRM/Contribute/Page/ContributionPage.php:297 [40] => CRM/Grant/Info.php:138 [41] => CRM/Contribute/Form/SoftCredit.php:136 ) ' echo '' echo 'Total number of edits to perform: 42' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 380 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 396 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 179 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 185 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 312 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 330 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 346 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 354 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 371 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 478 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 482 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 495 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 719 edit_at_line 'tests/phpunit/api/v3/ProfileTest.php' 936 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 645 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 84 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 303 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 324 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 353 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 461 edit_at_line 'CRM/Event/Page/ManageEvent.php' 217 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 492 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 532 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 756 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 1336 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 1337 edit_at_line 'CRM/UF/Form/Field.php' 114 edit_at_line 'CRM/UF/Form/Field.php' 297 edit_at_line 'CRM/UF/Form/Field.php' 565 edit_at_line 'CRM/UF/Form/Field.php' 634 edit_at_line 'CRM/UF/Form/Field.php' 690 edit_at_line 'CRM/UF/Form/Field.php' 799 edit_at_line 'CRM/UF/Form/Field.php' 991 edit_at_line 'CRM/UF/Form/Field.php' 1003 edit_at_line 'CRM/Event/Form/Participant.php' 293 edit_at_line 'CRM/Event/Form/Participant.php' 646 edit_at_line 'CRM/Event/Form/Participant.php' 745 edit_at_line 'CRM/Event/Form/Participant.php' 1092 edit_at_line 'CRM/Event/Form/Participant.php' 1325 edit_at_line 'CRM/Contribute/Page/ContributionPage.php' 297 edit_at_line 'CRM/Grant/Info.php' 138 edit_at_line 'CRM/Contribute/Form/SoftCredit.php' 136 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for function return type [1] => Expected \"array|bool\" but found \"Array|bool\" for function return type [2] => Expected \"array\" but found \"Array\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Event/Form/ManageEvent/Registration.php:675 [1] => CRM/Event/Form/ManageEvent/Registration.php:696 [2] => CRM/Event/Form/ManageEvent/Registration.php:731 [3] => CRM/Contribute/BAO/Contribution.php:847 [4] => CRM/Contribute/BAO/Contribution.php:2573 [5] => CRM/Contribute/BAO/Contribution.php:3159 [6] => CRM/UF/Form/Field.php:680 [7] => CRM/Case/BAO/Case.php:2803 [8] => CRM/Case/BAO/Case.php:3114 [9] => CRM/Case/BAO/Case.php:3385 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 675 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 696 edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 731 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 847 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 2573 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 3159 edit_at_line 'CRM/UF/Form/Field.php' 680 edit_at_line 'CRM/Case/BAO/Case.php' 2803 edit_at_line 'CRM/Case/BAO/Case.php' 3114 edit_at_line 'CRM/Case/BAO/Case.php' 3385 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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/Event/Form/ManageEvent/Registration.php:732 [1] => CRM/Core/BAO/ActionSchedule.php:73 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Form/ManageEvent/Registration.php' 732 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 73 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' 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] => tests/phpunit/CiviTest/CiviUnitTestCase.php:192 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 192 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"assertDBCompareValue\" [1] => Visibility must be declared on method \"mergeCases\" [2] => Visibility must be declared on method \"actionLinks\" [3] => Visibility must be declared on method \"getCampaignIds\" [4] => Visibility must be declared on method \"pager\" [5] => Visibility must be declared on method \"pdflib\" [6] => Visibility must be declared on method \"all\" ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviUnitTestCase.php:682 [1] => CRM/Case/BAO/Case.php:2344 [2] => CRM/Contribute/Page/ContributionPage.php:74 [3] => CRM/Contribute/Page/ContributionPage.php:627 [4] => CRM/Contribute/Page/ContributionPage.php:643 [5] => CRM/Utils/PDF/Utils.php:304 [6] => CRM/Report/Interface.php:77 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 682 edit_at_line 'CRM/Case/BAO/Case.php' 2344 edit_at_line 'CRM/Contribute/Page/ContributionPage.php' 74 edit_at_line 'CRM/Contribute/Page/ContributionPage.php' 627 edit_at_line 'CRM/Contribute/Page/ContributionPage.php' 643 edit_at_line 'CRM/Utils/PDF/Utils.php' 304 edit_at_line 'CRM/Report/Interface.php' 77 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => is_integer() is a function name alias, use is_int() instead [1] => sizeof() is a function name alias, use count() instead ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1027 [1] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1179 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1027 edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1179 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' 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] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1307 [1] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1335 [2] => CRM/Campaign/Form/Task/Interview.php:469 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1307 edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1335 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 469 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1814 [1] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1932 [2] => CRM/Case/BAO/Case.php:156 [3] => CRM/Case/BAO/Case.php:198 [4] => CRM/Core/BAO/Domain.php:134 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1814 edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1932 edit_at_line 'CRM/Case/BAO/Case.php' 156 edit_at_line 'CRM/Case/BAO/Case.php' 198 edit_at_line 'CRM/Core/BAO/Domain.php' 134 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ReturnCommentIndentation' echo 'Messages:Array ( [0] => Return comment indentation must be 3 spaces, found 1 spaces ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviUnitTestCase.php:1856 [1] => api/v3/Profile.php:48 [2] => api/v3/Profile.php:49 [3] => api/v3/Profile.php:50 [4] => api/v3/Profile.php:51 [5] => api/v3/Profile.php:53 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 1856 edit_at_line 'api/v3/Profile.php' 48 edit_at_line 'api/v3/Profile.php' 49 edit_at_line 'api/v3/Profile.php' 50 edit_at_line 'api/v3/Profile.php' 51 edit_at_line 'api/v3/Profile.php' 53 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeClosingBrace.Indent' echo 'Messages:Array ( [0] => Closing brace indented incorrectly; expected 2 spaces, found 3 ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviUnitTestCase.php:2028 [1] => tests/phpunit/CiviTest/CiviUnitTestCase.php:2040 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 2028 edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 2040 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeClosingBrace.Indent!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingReturnType' echo 'Messages:Array ( [0] => Return type missing for @return tag in function comment ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviUnitTestCase.php:3103 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviUnitTestCase.php' 3103 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingReturnType!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayClosingIndentation' echo 'Messages:Array ( [0] => Array closing indentation error, expected 4 spaces but found 6 [1] => Array closing indentation error, expected 2 spaces but found 3 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Contribute/Lybunt.php:122 [1] => CRM/Report/Form/Pledge/Detail.php:176 [2] => api/v3/Profile.php:686 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 122 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 176 edit_at_line 'api/v3/Profile.php' 686 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OperatorSpacing.SpacingBefore' echo 'Messages:Array ( [0] => Expected 1 space before \"+\"; newline found ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Contribute/Lybunt.php:123 [1] => CRM/Report/Form/Contribute/Lybunt.php:124 [2] => CRM/Report/Form/Pledge/Detail.php:177 [3] => CRM/Report/Form/Pledge/Detail.php:178 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 123 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 124 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 177 edit_at_line 'CRM/Report/Form/Pledge/Detail.php' 178 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OperatorSpacing.SpacingBefore!' 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/Contribute/Lybunt.php:319 [1] => CRM/Report/Form/Contribute/Lybunt.php:383 [2] => CRM/Report/Form/Contribute/Lybunt.php:444 [3] => CRM/Campaign/Form/Task/Interview.php:111 [4] => CRM/Campaign/Form/Task/Interview.php:291 [5] => CRM/Campaign/Form/Task/Interview.php:411 [6] => CRM/Campaign/Form/Task/Interview.php:432 [7] => CRM/Event/Page/ManageEvent.php:114 [8] => CRM/Event/Page/ManageEvent.php:120 [9] => CRM/Event/Page/ManageEvent.php:127 [10] => CRM/Event/Page/ManageEvent.php:133 [11] => CRM/Event/Page/ManageEvent.php:140 [12] => CRM/Event/Page/ManageEvent.php:147 [13] => CRM/Event/Page/ManageEvent.php:153 [14] => CRM/Event/Page/ManageEvent.php:159 [15] => CRM/Event/Page/ManageEvent.php:165 [16] => CRM/Core/BAO/ActionSchedule.php:704 [17] => CRM/Core/BAO/ActionSchedule.php:708 [18] => CRM/Core/BAO/ActionSchedule.php:712 [19] => CRM/Core/BAO/ActionSchedule.php:883 [20] => CRM/Event/Form/Participant.php:1081 [21] => CRM/Event/Form/Participant.php:1118 [22] => CRM/Event/Form/Participant.php:1231 ) ' echo '' echo 'Total number of edits to perform: 23' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 319 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 383 edit_at_line 'CRM/Report/Form/Contribute/Lybunt.php' 444 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 111 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 291 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 411 edit_at_line 'CRM/Campaign/Form/Task/Interview.php' 432 edit_at_line 'CRM/Event/Page/ManageEvent.php' 114 edit_at_line 'CRM/Event/Page/ManageEvent.php' 120 edit_at_line 'CRM/Event/Page/ManageEvent.php' 127 edit_at_line 'CRM/Event/Page/ManageEvent.php' 133 edit_at_line 'CRM/Event/Page/ManageEvent.php' 140 edit_at_line 'CRM/Event/Page/ManageEvent.php' 147 edit_at_line 'CRM/Event/Page/ManageEvent.php' 153 edit_at_line 'CRM/Event/Page/ManageEvent.php' 159 edit_at_line 'CRM/Event/Page/ManageEvent.php' 165 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 704 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 708 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 712 edit_at_line 'CRM/Core/BAO/ActionSchedule.php' 883 edit_at_line 'CRM/Event/Form/Participant.php' 1081 edit_at_line 'CRM/Event/Form/Participant.php' 1118 edit_at_line 'CRM/Event/Form/Participant.php' 1231 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' 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/Contribute/BAO/Contribution.php:94 [1] => CRM/Case/BAO/Case.php:1859 [2] => CRM/Case/BAO/Case.php:2003 [3] => api/v3/Profile.php:498 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Contribution.php' 94 edit_at_line 'CRM/Case/BAO/Case.php' 1859 edit_at_line 'CRM/Case/BAO/Case.php' 2003 edit_at_line 'api/v3/Profile.php' 498 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/Contribute/BAO/Contribution.php:2463 [1] => CRM/Contribute/BAO/Contribution.php:2777 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Contribution.php' 2463 edit_at_line 'CRM/Contribute/BAO/Contribution.php' 2777 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Commenting.DocCommentAlignment.SpaceAfterStar' echo 'Messages:Array ( [0] => Expected 1 space after asterisk; 3 found ) ' echo 'Lines:Array ( [0] => CRM/Contribute/BAO/Contribution.php:3155 [1] => CRM/Case/BAO/Case.php:3381 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Contribution.php' 3155 edit_at_line 'CRM/Case/BAO/Case.php' 3381 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Commenting.DocCommentAlignment.SpaceAfterStar!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.SeePunctuation' echo 'Messages:Array ( [0] => Trailing punctuation for @see references is not allowed. ) ' echo 'Lines:Array ( [0] => CRM/Contribute/BAO/Contribution.php:3155 [1] => CRM/Case/BAO/Case.php:3381 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Contribution.php' 3155 edit_at_line 'CRM/Case/BAO/Case.php' 3381 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SeePunctuation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OperatorSpacing.SpacingAfterAmp' echo 'Messages:Array ( [0] => Expected 1 space after \"&\" operator; newline found ) ' echo 'Lines:Array ( [0] => CRM/Event/Page/ManageEvent.php:421 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/Page/ManageEvent.php' 421 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OperatorSpacing.SpacingAfterAmp!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $fieldType does not match actual variable name $errors ) ' echo 'Lines:Array ( [0] => CRM/UF/Form/Field.php:621 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/UF/Form/Field.php' 621 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' 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/UF/Form/Field.php:626 [1] => CRM/Case/BAO/Case.php:200 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/UF/Form/Field.php' 626 edit_at_line 'CRM/Case/BAO/Case.php' 200 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.ControlStructures.ControlSignature' echo 'Messages:Array ( [0] => Expected \"elseif (...) {\n\"; found \"elseif(...) {\n\" ) ' echo 'Lines:Array ( [0] => api/v3/Profile.php:118 [1] => api/v3/Profile.php:450 [2] => api/v3/Profile.php:464 [3] => api/v3/Profile.php:647 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Profile.php' 118 edit_at_line 'api/v3/Profile.php' 450 edit_at_line 'api/v3/Profile.php' 464 edit_at_line 'api/v3/Profile.php' 647 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.ControlSignature!' echo '' echo 'Yay!' echo '' fi