#!/bin/bash ## usage: bash batch-15.sh.txt #[ -n "$1" ] && EDITOR="$1" #if [ -z "$EDITOR" ]; then # echo "Please provide parameter 1 (editor). Example: vi, joe" # exit 1 #fi function edit_at_line() { local f="$1" local l="$2" $EDITOR +$l "$f" } function ask_continue() { local line="" while [ "$line" != "y" -a "$line" != "n" ]; do echo -n "$1 (Y/n) " read line if [ -z "$line" ]; then line=y fi done if [ "$line" == "y" ]; then return 0 else return 1 fi } echo 'Welcome and thanks for helping with the cleanup!' echo '' echo 'This script will walk through a series of code-style issues in Civi'\''s PHP code.' echo 'For each issue, it will show a summary of the issue (ie how many files are' echo 'affected, how many lines of code are affected, and what detailed messages' echo 'are available about the issues.' echo '' echo 'The script will open the first file at the offending line so that you can fix' echo 'it. Please save, edit, close. The script will then repeat -- re-opening the text' echo 'editor at each offending line.' echo '' echo 'The script should generally open on the exact line with the problem; however,' echo 'if other changes were recently made to the file, then the line numbers may be' echo 'slightly off - if you don'\''t see a problem, then check the neighboring lines.' ask_continue 'Continue?' || exit echo '' echo 'What text editor would you prefer to use? [vi, emacs, joe]?' read EDITOR echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Financial/BAO/PaymentProcessor.php:136 [1] => CRM/Custom/Page/Option.php:72 [2] => CRM/Custom/Page/Option.php:116 [3] => CRM/Custom/Page/Option.php:268 [4] => api/v3/LocationType.php:90 [5] => CRM/Core/I18n.php:179 [6] => CRM/Contribute/BAO/ContributionPage.php:927 [7] => CRM/Import/Form/MapField.php:97 [8] => CRM/Import/Form/MapField.php:98 [9] => CRM/Import/Form/MapField.php:121 [10] => CRM/Import/Form/MapField.php:122 [11] => CRM/Price/Form/DeleteField.php:58 [12] => CRM/Price/Form/DeleteField.php:79 [13] => CRM/Price/Form/DeleteField.php:101 [14] => api/v3/Country.php:87 [15] => CRM/Price/Page/Field.php:72 [16] => CRM/Price/Page/Field.php:116 [17] => CRM/Price/Page/Field.php:244 [18] => CRM/Core/Selector/Base.php:66 [19] => CRM/Core/Selector/Base.php:67 [20] => CRM/Core/Selector/Base.php:115 [21] => CRM/Price/Page/Set.php:56 [22] => CRM/Price/Page/Set.php:122 ) ' echo '' echo 'Total number of edits to perform: 23' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Financial/BAO/PaymentProcessor.php' 136 edit_at_line 'CRM/Custom/Page/Option.php' 72 edit_at_line 'CRM/Custom/Page/Option.php' 116 edit_at_line 'CRM/Custom/Page/Option.php' 268 edit_at_line 'api/v3/LocationType.php' 90 edit_at_line 'CRM/Core/I18n.php' 179 edit_at_line 'CRM/Contribute/BAO/ContributionPage.php' 927 edit_at_line 'CRM/Import/Form/MapField.php' 97 edit_at_line 'CRM/Import/Form/MapField.php' 98 edit_at_line 'CRM/Import/Form/MapField.php' 121 edit_at_line 'CRM/Import/Form/MapField.php' 122 edit_at_line 'CRM/Price/Form/DeleteField.php' 58 edit_at_line 'CRM/Price/Form/DeleteField.php' 79 edit_at_line 'CRM/Price/Form/DeleteField.php' 101 edit_at_line 'api/v3/Country.php' 87 edit_at_line 'CRM/Price/Page/Field.php' 72 edit_at_line 'CRM/Price/Page/Field.php' 116 edit_at_line 'CRM/Price/Page/Field.php' 244 edit_at_line 'CRM/Core/Selector/Base.php' 66 edit_at_line 'CRM/Core/Selector/Base.php' 67 edit_at_line 'CRM/Core/Selector/Base.php' 115 edit_at_line 'CRM/Price/Page/Set.php' 56 edit_at_line 'CRM/Price/Page/Set.php' 122 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"int\" but found \"number\" for function return type [1] => Expected \"bool\" but found \"boolean\" for function return type [2] => Expected \"array\" but found \"Array\" for function return type [3] => Expected \"bool\" but found \"Boolean\" for function return type [4] => Expected \"object\" but found \"stdClass\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Financial/BAO/PaymentProcessor.php:242 [1] => CRM/Core/Permission.php:117 [2] => CRM/Core/Permission.php:165 [3] => CRM/Core/Permission.php:676 [4] => CRM/Contact/BAO/Contact/Permission.php:44 [5] => CRM/Contact/BAO/Contact/Permission.php:157 [6] => api/v3/Relationship.php:107 [7] => api/v3/Pledge.php:71 [8] => CRM/Core/I18n.php:414 [9] => CRM/Contribute/BAO/ContributionPage.php:715 [10] => CRM/Price/BAO/PriceSet.php:282 [11] => api/v3/Country.php:76 [12] => CRM/Core/Permission/Drupal6.php:72 [13] => CRM/Core/Permission/Drupal6.php:98 [14] => CRM/Widget/Widget.php:65 [15] => CRM/Report/Utils/Report.php:365 ) ' echo '' echo 'Total number of edits to perform: 16' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Financial/BAO/PaymentProcessor.php' 242 edit_at_line 'CRM/Core/Permission.php' 117 edit_at_line 'CRM/Core/Permission.php' 165 edit_at_line 'CRM/Core/Permission.php' 676 edit_at_line 'CRM/Contact/BAO/Contact/Permission.php' 44 edit_at_line 'CRM/Contact/BAO/Contact/Permission.php' 157 edit_at_line 'api/v3/Relationship.php' 107 edit_at_line 'api/v3/Pledge.php' 71 edit_at_line 'CRM/Core/I18n.php' 414 edit_at_line 'CRM/Contribute/BAO/ContributionPage.php' 715 edit_at_line 'CRM/Price/BAO/PriceSet.php' 282 edit_at_line 'api/v3/Country.php' 76 edit_at_line 'CRM/Core/Permission/Drupal6.php' 72 edit_at_line 'CRM/Core/Permission/Drupal6.php' 98 edit_at_line 'CRM/Widget/Widget.php' 65 edit_at_line 'CRM/Report/Utils/Report.php' 365 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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 [1] => A comma should follow the last multiline array item. Found: '\''recur'\'' [2] => A comma should follow the last multiline array item. Found: ] [3] => A comma should follow the last multiline array item. Found: ) [4] => A comma should follow the last multiline array item. Found: '\''email'\'' [5] => A comma should follow the last multiline array item. Found: '\''postal_greeting'\'' [6] => A comma should follow the last multiline array item. Found: TRUE [7] => A comma should follow the last multiline array item. Found: '\''%count contacts were already not in this group'\'' [8] => A comma should follow the last multiline array item. Found: $removed [9] => A comma should follow the last multiline array item. Found: '\''true'\'' [10] => A comma should follow the last multiline array item. Found: '\''%count contacts added to group'\'' [11] => A comma should follow the last multiline array item. Found: '\''%count contacts were already in group'\'' [12] => A comma should follow the last multiline array item. Found: '\''Added Contacts to %1'\'' [13] => A comma should follow the last multiline array item. Found: '\''StateProvince'\'' [14] => A comma should follow the last multiline array item. Found: '\''grant'\'' [15] => A comma should follow the last multiline array item. Found: '\''do_'\'' [16] => A comma should follow the last multiline array item. Found: '\''CRM_Member_Form_Membership'\'' [17] => A comma should follow the last multiline array item. Found: '\''Individual'\'' [18] => A comma should follow the last multiline array item. Found: '\''Organization'\'' [19] => A comma should follow the last multiline array item. Found: _softIndividual2Id [20] => A comma should follow the last multiline array item. Found: '\''activities,contacts'\'' [21] => A comma should follow the last multiline array item. Found: \"'\''], '\''add'\'')\" [22] => A comma should follow the last multiline array item. Found: \"'\''], '\''remove'\'')\" [23] => A comma should follow the last multiline array item. Found: '\''overflow: hidden; visibility: hidden; width: 1px; height: 0;'\'' [24] => A comma should follow the last multiline array item. Found: '\''Overdue'\'' [25] => A comma should follow the last multiline array item. Found: '\''Failed'\'' ) ' echo 'Lines:Array ( [0] => CRM/Financial/BAO/PaymentProcessor.php:318 [1] => CRM/Financial/BAO/PaymentProcessor.php:421 [2] => CRM/Event/Form/Registration/ParticipantConfirm.php:123 [3] => CRM/Event/Form/Registration/ParticipantConfirm.php:128 [4] => CRM/Event/Form/Registration/ParticipantConfirm.php:137 [5] => CRM/Event/Form/Registration/ParticipantConfirm.php:153 [6] => CRM/Mailing/MailStore/Mbox.php:62 [7] => CRM/Mailing/MailStore/Mbox.php:68 [8] => CRM/Mailing/MailStore/Pop3.php:71 [9] => CRM/Mailing/MailStore/Pop3.php:77 [10] => tests/phpunit/api/v3/EventTest.php:255 [11] => tests/phpunit/api/v3/EventTest.php:298 [12] => CRM/Custom/Page/Option.php:291 [13] => CRM/Contribute/Form/Contribution.php:667 [14] => CRM/Contact/Selector.php:415 [15] => CRM/Contact/Selector.php:596 [16] => CRM/Contact/Selector.php:681 [17] => CRM/Contribute/BAO/ContributionPage.php:936 [18] => CRM/Contact/Form/Task/RemoveFromGroup.php:90 [19] => CRM/Contact/Form/Task/RemoveFromGroup.php:91 [20] => CRM/Contact/Form/Task/RemoveFromGroup.php:96 [21] => CRM/Contact/Form/Task/RemoveFromGroup.php:102 [22] => bin/deprecated/UpdateGreeting.php:88 [23] => bin/deprecated/UpdateGreeting.php:133 [24] => CRM/Contact/Form/Task/AddToGroup.php:237 [25] => CRM/Contact/Form/Task/AddToGroup.php:238 [26] => CRM/Contact/Form/Task/AddToGroup.php:243 [27] => CRM/Contact/Form/Task/AddToGroup.php:250 [28] => CRM/Contact/Form/Search/Builder.php:216 [29] => CRM/Contact/Form/Search/Builder.php:453 [30] => CRM/Contact/Form/Search/Builder.php:471 [31] => CRM/Price/BAO/PriceSet.php:906 [32] => tests/phpunit/api/v3/CustomValueContactTypeTest.php:123 [33] => tests/phpunit/api/v3/CustomValueContactTypeTest.php:128 [34] => tests/phpunit/api/v3/ContributionSoftTest.php:137 [35] => tests/phpunit/api/v3/CaseTest.php:174 [36] => tests/phpunit/api/v3/CaseTest.php:194 [37] => tests/phpunit/api/v3/CaseTest.php:213 [38] => tests/phpunit/api/v3/CaseTest.php:229 [39] => CRM/Core/QuickForm/GroupMultiSelect.php:121 [40] => CRM/Core/QuickForm/GroupMultiSelect.php:129 [41] => CRM/Core/QuickForm/GroupMultiSelect.php:137 [42] => CRM/Pledge/BAO/Pledge.php:783 [43] => CRM/Pledge/BAO/Pledge.php:842 [44] => CRM/Pledge/BAO/Pledge.php:1128 [45] => CRM/Mailing/MailStore/Localdir.php:59 [46] => CRM/Mailing/MailStore/Localdir.php:65 ) ' echo '' echo 'Total number of edits to perform: 47' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Financial/BAO/PaymentProcessor.php' 318 edit_at_line 'CRM/Financial/BAO/PaymentProcessor.php' 421 edit_at_line 'CRM/Event/Form/Registration/ParticipantConfirm.php' 123 edit_at_line 'CRM/Event/Form/Registration/ParticipantConfirm.php' 128 edit_at_line 'CRM/Event/Form/Registration/ParticipantConfirm.php' 137 edit_at_line 'CRM/Event/Form/Registration/ParticipantConfirm.php' 153 edit_at_line 'CRM/Mailing/MailStore/Mbox.php' 62 edit_at_line 'CRM/Mailing/MailStore/Mbox.php' 68 edit_at_line 'CRM/Mailing/MailStore/Pop3.php' 71 edit_at_line 'CRM/Mailing/MailStore/Pop3.php' 77 edit_at_line 'tests/phpunit/api/v3/EventTest.php' 255 edit_at_line 'tests/phpunit/api/v3/EventTest.php' 298 edit_at_line 'CRM/Custom/Page/Option.php' 291 edit_at_line 'CRM/Contribute/Form/Contribution.php' 667 edit_at_line 'CRM/Contact/Selector.php' 415 edit_at_line 'CRM/Contact/Selector.php' 596 edit_at_line 'CRM/Contact/Selector.php' 681 edit_at_line 'CRM/Contribute/BAO/ContributionPage.php' 936 edit_at_line 'CRM/Contact/Form/Task/RemoveFromGroup.php' 90 edit_at_line 'CRM/Contact/Form/Task/RemoveFromGroup.php' 91 edit_at_line 'CRM/Contact/Form/Task/RemoveFromGroup.php' 96 edit_at_line 'CRM/Contact/Form/Task/RemoveFromGroup.php' 102 edit_at_line 'bin/deprecated/UpdateGreeting.php' 88 edit_at_line 'bin/deprecated/UpdateGreeting.php' 133 edit_at_line 'CRM/Contact/Form/Task/AddToGroup.php' 237 edit_at_line 'CRM/Contact/Form/Task/AddToGroup.php' 238 edit_at_line 'CRM/Contact/Form/Task/AddToGroup.php' 243 edit_at_line 'CRM/Contact/Form/Task/AddToGroup.php' 250 edit_at_line 'CRM/Contact/Form/Search/Builder.php' 216 edit_at_line 'CRM/Contact/Form/Search/Builder.php' 453 edit_at_line 'CRM/Contact/Form/Search/Builder.php' 471 edit_at_line 'CRM/Price/BAO/PriceSet.php' 906 edit_at_line 'tests/phpunit/api/v3/CustomValueContactTypeTest.php' 123 edit_at_line 'tests/phpunit/api/v3/CustomValueContactTypeTest.php' 128 edit_at_line 'tests/phpunit/api/v3/ContributionSoftTest.php' 137 edit_at_line 'tests/phpunit/api/v3/CaseTest.php' 174 edit_at_line 'tests/phpunit/api/v3/CaseTest.php' 194 edit_at_line 'tests/phpunit/api/v3/CaseTest.php' 213 edit_at_line 'tests/phpunit/api/v3/CaseTest.php' 229 edit_at_line 'CRM/Core/QuickForm/GroupMultiSelect.php' 121 edit_at_line 'CRM/Core/QuickForm/GroupMultiSelect.php' 129 edit_at_line 'CRM/Core/QuickForm/GroupMultiSelect.php' 137 edit_at_line 'CRM/Pledge/BAO/Pledge.php' 783 edit_at_line 'CRM/Pledge/BAO/Pledge.php' 842 edit_at_line 'CRM/Pledge/BAO/Pledge.php' 1128 edit_at_line 'CRM/Mailing/MailStore/Localdir.php' 59 edit_at_line 'CRM/Mailing/MailStore/Localdir.php' 65 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] => tests/phpunit/CRM/Queue/RunnerTest.php:243 [1] => tests/phpunit/CRM/Queue/RunnerTest.php:254 [2] => tests/phpunit/CRM/Queue/RunnerTest.php:265 [3] => tests/phpunit/CRM/Queue/RunnerTest.php:277 [4] => CRM/Core/I18n/SchemaStructure_3_3_beta1.php:38 [5] => CRM/Core/I18n/SchemaStructure_3_3_beta1.php:207 [6] => CRM/Core/I18n/SchemaStructure_3_3_beta1.php:289 [7] => CRM/Core/Permission/Drupal6.php:100 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Queue/RunnerTest.php' 243 edit_at_line 'tests/phpunit/CRM/Queue/RunnerTest.php' 254 edit_at_line 'tests/phpunit/CRM/Queue/RunnerTest.php' 265 edit_at_line 'tests/phpunit/CRM/Queue/RunnerTest.php' 277 edit_at_line 'CRM/Core/I18n/SchemaStructure_3_3_beta1.php' 38 edit_at_line 'CRM/Core/I18n/SchemaStructure_3_3_beta1.php' 207 edit_at_line 'CRM/Core/I18n/SchemaStructure_3_3_beta1.php' 289 edit_at_line 'CRM/Core/Permission/Drupal6.php' 100 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Classes.ClassCreateInstance' echo 'Messages:Array ( [0] => Calling class constructors must always include parentheses [1] => Between the class name and the opening parenthesis spaces are not welcome ) ' echo 'Lines:Array ( [0] => CRM/Mailing/MailStore/Mbox.php:101 [1] => CRM/Mailing/MailStore/Mbox.php:119 [2] => CRM/Mailing/MailStore/Pop3.php:94 [3] => CRM/Mailing/MailStore/Pop3.php:112 [4] => CRM/Core/Invoke.php:292 [5] => CRM/Core/Invoke.php:302 [6] => CRM/Contact/Form/Search.php:800 [7] => CRM/Pledge/BAO/PledgePayment.php:216 [8] => CRM/Mailing/MailStore/Localdir.php:104 [9] => CRM/Core/Payment/IATS.php:109 [10] => CRM/Core/Payment/IATS.php:113 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Mailing/MailStore/Mbox.php' 101 edit_at_line 'CRM/Mailing/MailStore/Mbox.php' 119 edit_at_line 'CRM/Mailing/MailStore/Pop3.php' 94 edit_at_line 'CRM/Mailing/MailStore/Pop3.php' 112 edit_at_line 'CRM/Core/Invoke.php' 292 edit_at_line 'CRM/Core/Invoke.php' 302 edit_at_line 'CRM/Contact/Form/Search.php' 800 edit_at_line 'CRM/Pledge/BAO/PledgePayment.php' 216 edit_at_line 'CRM/Mailing/MailStore/Localdir.php' 104 edit_at_line 'CRM/Core/Payment/IATS.php' 109 edit_at_line 'CRM/Core/Payment/IATS.php' 113 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' 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/Core/Permission.php:677 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Permission.php' 677 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' 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/Contact/Permission.php:147 [1] => CRM/Core/CodeGen/Specification.php:277 [2] => CRM/Core/Component.php:233 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/Contact/Permission.php' 147 edit_at_line 'CRM/Core/CodeGen/Specification.php' 277 edit_at_line 'CRM/Core/Component.php' 233 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"hasContactsInCache\" [1] => Visibility must be declared on method \"localizeArray\" [2] => Visibility must be declared on method \"__construct\" [3] => Visibility must be declared on method \"initialize\" [4] => Visibility must be declared on method \"preProcess\" [5] => Visibility must be declared on method \"actionLinks\" [6] => Visibility must be declared on method \"columns\" [7] => Visibility must be declared on method \"indices\" [8] => Visibility must be declared on method \"tables\" [9] => Visibility must be declared on method \"updatePledgePaymentStatus\" [10] => Visibility must be declared on method \"updatePledgePayments\" [11] => Visibility must be declared on method \"defaultReturnProperties\" ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/Contact/Permission.php:159 [1] => CRM/Core/I18n.php:371 [2] => CRM/Contact/Selector.php:156 [3] => bin/deprecated/UpdateGreeting.php:47 [4] => bin/deprecated/UpdateGreeting.php:63 [5] => CRM/Price/Form/DeleteField.php:63 [6] => CRM/Price/Page/Field.php:77 [7] => CRM/Core/I18n/SchemaStructure.php:37 [8] => CRM/Core/I18n/SchemaStructure.php:191 [9] => CRM/Core/I18n/SchemaStructure.php:229 [10] => CRM/Price/Page/Set.php:61 [11] => CRM/Pledge/BAO/PledgePayment.php:342 [12] => CRM/Pledge/BAO/PledgePayment.php:634 [13] => CRM/Core/Component.php:330 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/Contact/Permission.php' 159 edit_at_line 'CRM/Core/I18n.php' 371 edit_at_line 'CRM/Contact/Selector.php' 156 edit_at_line 'bin/deprecated/UpdateGreeting.php' 47 edit_at_line 'bin/deprecated/UpdateGreeting.php' 63 edit_at_line 'CRM/Price/Form/DeleteField.php' 63 edit_at_line 'CRM/Price/Page/Field.php' 77 edit_at_line 'CRM/Core/I18n/SchemaStructure.php' 37 edit_at_line 'CRM/Core/I18n/SchemaStructure.php' 191 edit_at_line 'CRM/Core/I18n/SchemaStructure.php' 229 edit_at_line 'CRM/Price/Page/Set.php' 61 edit_at_line 'CRM/Pledge/BAO/PledgePayment.php' 342 edit_at_line 'CRM/Pledge/BAO/PledgePayment.php' 634 edit_at_line 'CRM/Core/Component.php' 330 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/api/v3/EventTest.php:115 [1] => tests/phpunit/api/v3/EventTest.php:268 [2] => tests/phpunit/api/v3/CustomValueContactTypeTest.php:118 [3] => tests/phpunit/api/v3/ContributionSoftTest.php:159 [4] => tests/phpunit/api/v3/ContributionSoftTest.php:220 [5] => tests/phpunit/api/v3/ContributionSoftTest.php:281 [6] => CRM/Report/Form/Member/Summary.php:344 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/EventTest.php' 115 edit_at_line 'tests/phpunit/api/v3/EventTest.php' 268 edit_at_line 'tests/phpunit/api/v3/CustomValueContactTypeTest.php' 118 edit_at_line 'tests/phpunit/api/v3/ContributionSoftTest.php' 159 edit_at_line 'tests/phpunit/api/v3/ContributionSoftTest.php' 220 edit_at_line 'tests/phpunit/api/v3/ContributionSoftTest.php' 281 edit_at_line 'CRM/Report/Form/Member/Summary.php' 344 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/Contribute/Form/Contribution.php:1553 [1] => CRM/Price/BAO/PriceSet.php:1329 [2] => CRM/Contact/Form/Search.php:345 [3] => CRM/Contact/Form/Search.php:378 [4] => CRM/Contact/Form/Search.php:420 [5] => CRM/Core/CodeGen/Specification.php:50 [6] => CRM/Report/Form/Member/Summary.php:244 [7] => CRM/Report/Form/Member/Summary.php:416 [8] => CRM/Report/Form/Contribute/PCP.php:267 ) ' echo '' echo 'Total number of edits to perform: 9' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/Contribution.php' 1553 edit_at_line 'CRM/Price/BAO/PriceSet.php' 1329 edit_at_line 'CRM/Contact/Form/Search.php' 345 edit_at_line 'CRM/Contact/Form/Search.php' 378 edit_at_line 'CRM/Contact/Form/Search.php' 420 edit_at_line 'CRM/Core/CodeGen/Specification.php' 50 edit_at_line 'CRM/Report/Form/Member/Summary.php' 244 edit_at_line 'CRM/Report/Form/Member/Summary.php' 416 edit_at_line 'CRM/Report/Form/Contribute/PCP.php' 267 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' 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/Form/Contribution.php:1765 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/Contribution.php' 1765 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' 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/Contribute/Form/Contribution.php:1821 [1] => api/v3/Pledge.php:168 [2] => api/v3/ReportTemplate.php:167 [3] => CRM/Core/Component.php:426 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/Contribution.php' 1821 edit_at_line 'api/v3/Pledge.php' 168 edit_at_line 'api/v3/ReportTemplate.php' 167 edit_at_line 'CRM/Core/Component.php' 426 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Relationship.php:50 [1] => api/v3/Relationship.php:77 [2] => api/v3/Relationship.php:109 [3] => api/v3/Pledge.php:73 [4] => api/v3/Pledge.php:135 [5] => api/v3/LocationType.php:49 [6] => api/v3/LocationType.php:81 [7] => api/v3/LocationType.php:100 [8] => api/v3/ReportTemplate.php:15 [9] => api/v3/ReportTemplate.php:36 [10] => api/v3/ReportTemplate.php:77 [11] => CRM/Contact/Form/Search/Builder.php:426 [12] => api/v3/ContributionPage.php:47 [13] => api/v3/ContributionPage.php:77 [14] => api/v3/ContributionPage.php:95 [15] => api/v3/ContributionPage.php:113 [16] => api/v3/Country.php:78 [17] => api/v3/Country.php:97 [18] => CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php:52 [19] => CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php:53 [20] => api/v3/MailingJob.php:70 [21] => api/v3/EntityTag.php:83 ) ' echo '' echo 'Total number of edits to perform: 22' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Relationship.php' 50 edit_at_line 'api/v3/Relationship.php' 77 edit_at_line 'api/v3/Relationship.php' 109 edit_at_line 'api/v3/Pledge.php' 73 edit_at_line 'api/v3/Pledge.php' 135 edit_at_line 'api/v3/LocationType.php' 49 edit_at_line 'api/v3/LocationType.php' 81 edit_at_line 'api/v3/LocationType.php' 100 edit_at_line 'api/v3/ReportTemplate.php' 15 edit_at_line 'api/v3/ReportTemplate.php' 36 edit_at_line 'api/v3/ReportTemplate.php' 77 edit_at_line 'CRM/Contact/Form/Search/Builder.php' 426 edit_at_line 'api/v3/ContributionPage.php' 47 edit_at_line 'api/v3/ContributionPage.php' 77 edit_at_line 'api/v3/ContributionPage.php' 95 edit_at_line 'api/v3/ContributionPage.php' 113 edit_at_line 'api/v3/Country.php' 78 edit_at_line 'api/v3/Country.php' 97 edit_at_line 'CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php' 52 edit_at_line 'CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php' 53 edit_at_line 'api/v3/MailingJob.php' 70 edit_at_line 'api/v3/EntityTag.php' 83 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.ControlStructures.InlineControlStructure.NotAllowed' echo 'Messages:Array ( [0] => Inline control structures are not allowed ) ' echo 'Lines:Array ( [0] => CRM/Core/I18n.php:155 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/I18n.php' 155 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.IncorrectExact' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 6 spaces, found 8 [1] => Line indented incorrectly; expected 8 spaces, found 10 ) ' echo 'Lines:Array ( [0] => CRM/Contribute/BAO/ContributionPage.php:826 [1] => CRM/Core/CodeGen/Specification.php:306 [2] => CRM/Core/Payment/IATS.php:207 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/ContributionPage.php' 826 edit_at_line 'CRM/Core/CodeGen/Specification.php' 306 edit_at_line 'CRM/Core/Payment/IATS.php' 207 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 $isQuickConfigValue does not match actual variable name $isQuickConfig ) ' echo 'Lines:Array ( [0] => CRM/Price/BAO/PriceSet.php:1313 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Price/BAO/PriceSet.php' 1313 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturnNotVoid' echo 'Messages:Array ( [0] => Function return type is not void, but function is returning void here ) ' echo 'Lines:Array ( [0] => CRM/Core/Invoke.php:73 [1] => CRM/Core/Invoke.php:229 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Invoke.php' 73 edit_at_line 'CRM/Core/Invoke.php' 229 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.EmptyLines.EmptyLines' echo 'Messages:Array ( [0] => More than 2 empty lines are not allowed ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/CustomValueContactTypeTest.php:237 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/CustomValueContactTypeTest.php' 237 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.EmptyLines.EmptyLines!' echo '' echo 'Yay!' echo '' fi