#!/bin/bash ## usage: bash batch-11.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.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for function return type [1] => Expected \"array\" but found \"Array\" for function return type [2] => Expected \"array|bool\" but found \"Array|bool\" for function return type [3] => Expected \"bool|null|string|int\" but found \"bool|null|string|number\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Member/Import/Parser/Membership.php:115 [1] => CRM/Member/Import/Parser/Membership.php:127 [2] => CRM/Member/Import/Parser/Membership.php:140 [3] => CRM/Member/Import/Parser/Membership.php:257 [4] => CRM/Member/Import/Parser/Membership.php:597 [5] => CRM/Campaign/BAO/Survey.php:745 [6] => CRM/Core/OptionValue.php:253 [7] => CRM/Core/OptionValue.php:275 [8] => CRM/Core/PseudoConstant.php:211 [9] => CRM/Core/PseudoConstant.php:470 [10] => CRM/Core/Config.php:675 [11] => CRM/Core/Page.php:379 [12] => CRM/Core/Page.php:400 [13] => CRM/Core/BAO/EntityTag.php:106 [14] => CRM/Core/BAO/EntityTag.php:401 [15] => CRM/Core/BAO/Tag.php:323 [16] => CRM/Core/BAO/Tag.php:412 [17] => CRM/Contact/BAO/ContactType.php:453 [18] => CRM/Contact/BAO/ContactType.php:524 [19] => CRM/Contact/BAO/ContactType.php:737 [20] => CRM/Core/BAO/OpenID.php:81 ) ' echo '' echo 'Total number of edits to perform: 21' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/Import/Parser/Membership.php' 115 edit_at_line 'CRM/Member/Import/Parser/Membership.php' 127 edit_at_line 'CRM/Member/Import/Parser/Membership.php' 140 edit_at_line 'CRM/Member/Import/Parser/Membership.php' 257 edit_at_line 'CRM/Member/Import/Parser/Membership.php' 597 edit_at_line 'CRM/Campaign/BAO/Survey.php' 745 edit_at_line 'CRM/Core/OptionValue.php' 253 edit_at_line 'CRM/Core/OptionValue.php' 275 edit_at_line 'CRM/Core/PseudoConstant.php' 211 edit_at_line 'CRM/Core/PseudoConstant.php' 470 edit_at_line 'CRM/Core/Config.php' 675 edit_at_line 'CRM/Core/Page.php' 379 edit_at_line 'CRM/Core/Page.php' 400 edit_at_line 'CRM/Core/BAO/EntityTag.php' 106 edit_at_line 'CRM/Core/BAO/EntityTag.php' 401 edit_at_line 'CRM/Core/BAO/Tag.php' 323 edit_at_line 'CRM/Core/BAO/Tag.php' 412 edit_at_line 'CRM/Contact/BAO/ContactType.php' 453 edit_at_line 'CRM/Contact/BAO/ContactType.php' 524 edit_at_line 'CRM/Contact/BAO/ContactType.php' 737 edit_at_line 'CRM/Core/BAO/OpenID.php' 81 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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/Member/Import/Parser/Membership.php:597 [1] => CRM/Core/BAO/EntityTag.php:118 [2] => CRM/Core/Form/Date.php:233 [3] => CRM/Utils/SystemLogger.php:49 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Member/Import/Parser/Membership.php' 597 edit_at_line 'CRM/Core/BAO/EntityTag.php' 118 edit_at_line 'CRM/Core/Form/Date.php' 233 edit_at_line 'CRM/Utils/SystemLogger.php' 49 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Campaign/Form/Petition/Signature.php:223 [1] => CRM/Campaign/Form/Petition/Signature.php:346 [2] => CRM/Campaign/Form/Petition/Signature.php:498 [3] => CRM/Campaign/Form/Petition/Signature.php:619 [4] => CRM/Contact/Import/Form/DataSource.php:182 [5] => CRM/Contact/Form/Task/SMSCommon.php:272 [6] => CRM/Contact/BAO/ProximityQuery.php:323 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Form/Petition/Signature.php' 223 edit_at_line 'CRM/Campaign/Form/Petition/Signature.php' 346 edit_at_line 'CRM/Campaign/Form/Petition/Signature.php' 498 edit_at_line 'CRM/Campaign/Form/Petition/Signature.php' 619 edit_at_line 'CRM/Contact/Import/Form/DataSource.php' 182 edit_at_line 'CRM/Contact/Form/Task/SMSCommon.php' 272 edit_at_line 'CRM/Contact/BAO/ProximityQuery.php' 323 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' 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/Campaign/Form/Petition/Signature.php:328 [1] => CRM/Contact/Import/Form/DataSource.php:133 [2] => CRM/Core/Form/Date.php:90 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Form/Petition/Signature.php' 328 edit_at_line 'CRM/Contact/Import/Form/DataSource.php' 133 edit_at_line 'CRM/Core/Form/Date.php' 90 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' 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/Campaign/Form/Petition/Signature.php:573 [1] => CRM/Campaign/BAO/Survey.php:843 [2] => CRM/Profile/Form.php:670 [3] => CRM/Campaign/Form/Survey/Results.php:418 [4] => CRM/Campaign/Form/Survey/Results.php:428 [5] => CRM/Campaign/Form/Survey/Results.php:448 [6] => CRM/Core/Config.php:361 [7] => CRM/Logging/ReportDetail.php:73 [8] => CRM/Core/Form/Date.php:98 [9] => CRM/Core/Form/Date.php:137 [10] => CRM/Contact/BAO/ProximityQuery.php:222 [11] => CRM/Contact/BAO/ProximityQuery.php:227 [12] => CRM/Activity/Form/Activity.php:487 [13] => CRM/Activity/Form/Activity.php:569 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Form/Petition/Signature.php' 573 edit_at_line 'CRM/Campaign/BAO/Survey.php' 843 edit_at_line 'CRM/Profile/Form.php' 670 edit_at_line 'CRM/Campaign/Form/Survey/Results.php' 418 edit_at_line 'CRM/Campaign/Form/Survey/Results.php' 428 edit_at_line 'CRM/Campaign/Form/Survey/Results.php' 448 edit_at_line 'CRM/Core/Config.php' 361 edit_at_line 'CRM/Logging/ReportDetail.php' 73 edit_at_line 'CRM/Core/Form/Date.php' 98 edit_at_line 'CRM/Core/Form/Date.php' 137 edit_at_line 'CRM/Contact/BAO/ProximityQuery.php' 222 edit_at_line 'CRM/Contact/BAO/ProximityQuery.php' 227 edit_at_line 'CRM/Activity/Form/Activity.php' 487 edit_at_line 'CRM/Activity/Form/Activity.php' 569 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"init\" [1] => Visibility must be declared on method \"fini\" [2] => Visibility must be declared on method \"mapField\" [3] => Visibility must be declared on method \"preview\" [4] => Visibility must be declared on method \"summary\" [5] => Visibility must be declared on method \"import\" [6] => Visibility must be declared on method \"getSurveyActivityType\" [7] => Visibility must be declared on method \"voterActivityDetails\" [8] => Visibility must be declared on method \"getSurveyActivities\" [9] => Visibility must be declared on method \"__construct\" [10] => Visibility must be declared on method \"preProcess\" [11] => Visibility must be declared on method \"buildDateRange\" [12] => Visibility must be declared on method \"returnDateRangeSelector\" [13] => Visibility must be declared on method \"getTags\" [14] => Visibility must be declared on method \"_createFieldOptions\" [15] => Visibility must be declared on method \"getSelectElements\" [16] => Visibility must be declared on method \"deleteCustomSetForSubtypeMigration\" [17] => Visibility must be declared on method \"all\" ) ' echo 'Lines:Array ( [0] => CRM/Import/Parser.php:197 [1] => CRM/Import/Parser.php:202 [2] => CRM/Import/Parser.php:209 [3] => CRM/Import/Parser.php:216 [4] => CRM/Import/Parser.php:223 [5] => CRM/Import/Parser.php:231 [6] => CRM/Campaign/BAO/Survey.php:313 [7] => CRM/Campaign/BAO/Survey.php:525 [8] => CRM/Campaign/BAO/Survey.php:588 [9] => CRM/Activity/Selector/Activity.php:78 [10] => CRM/Price/Form/Preview.php:62 [11] => CRM/Core/Form/Date.php:92 [12] => CRM/Core/Form/Date.php:131 [13] => CRM/Core/BAO/Tag.php:201 [14] => tests/phpunit/WebTest/Admin/MoveCustomDataTest.php:420 [15] => CRM/Contact/BAO/ContactType.php:376 [16] => CRM/Contact/BAO/ContactType.php:870 [17] => CRM/Contact/Form/Search/Custom/PriceSet.php:279 ) ' echo '' echo 'Total number of edits to perform: 18' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Import/Parser.php' 197 edit_at_line 'CRM/Import/Parser.php' 202 edit_at_line 'CRM/Import/Parser.php' 209 edit_at_line 'CRM/Import/Parser.php' 216 edit_at_line 'CRM/Import/Parser.php' 223 edit_at_line 'CRM/Import/Parser.php' 231 edit_at_line 'CRM/Campaign/BAO/Survey.php' 313 edit_at_line 'CRM/Campaign/BAO/Survey.php' 525 edit_at_line 'CRM/Campaign/BAO/Survey.php' 588 edit_at_line 'CRM/Activity/Selector/Activity.php' 78 edit_at_line 'CRM/Price/Form/Preview.php' 62 edit_at_line 'CRM/Core/Form/Date.php' 92 edit_at_line 'CRM/Core/Form/Date.php' 131 edit_at_line 'CRM/Core/BAO/Tag.php' 201 edit_at_line 'tests/phpunit/WebTest/Admin/MoveCustomDataTest.php' 420 edit_at_line 'CRM/Contact/BAO/ContactType.php' 376 edit_at_line 'CRM/Contact/BAO/ContactType.php' 870 edit_at_line 'CRM/Contact/Form/Search/Custom/PriceSet.php' 279 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array' echo 'Messages:Array ( [0] => A comma should follow the last multiline array item. Found: '\''street_address'\'' [1] => A comma should follow the last multiline array item. Found: $scriptURL [2] => A comma should follow the last multiline array item. Found: '\''addressee'\'' [3] => A comma should follow the last multiline array item. Found: label [4] => A comma should follow the last multiline array item. Found: uploadDir [5] => A comma should follow the last multiline array item. Found: UPDATE [6] => A comma should follow the last multiline array item. Found: '\''%count matching contacts were found.
'\'' [7] => A comma should follow the last multiline array item. Found: '\''You can View the existing contacts.'\'' [8] => A comma should follow the last multiline array item. Found: '\''You can View or Edit the existing contacts.'\'' [9] => A comma should follow the last multiline array item. Found: '\''All'\'' [10] => A comma should follow the last multiline array item. Found: ) [11] => A comma should follow the last multiline array item. Found: '\''name'\'' [12] => A comma should follow the last multiline array item. Found: '\''%count selected activities consist of more than one target contact.'\'' [13] => A comma should follow the last multiline array item. Found: '\''%count selected activities are invalid.'\'' [14] => A comma should follow the last multiline array item. Found: $countSuccess [15] => A comma should follow the last multiline array item. Found: '\''%count Messages Not Sent'\'' [16] => A comma should follow the last multiline array item. Found: customFileUploadDir [17] => A comma should follow the last multiline array item. Found: PRINT_JSON [18] => A comma should follow the last multiline array item. Found: TRUE [19] => A comma should follow the last multiline array item. Found: '\''%count relationships created.'\'' [20] => A comma should follow the last multiline array item. Found: '\''%count relationship records were not created due to invalid contact types.'\'' [21] => A comma should follow the last multiline array item. Found: '\''%count invalid relationship records'\'' [22] => A comma should follow the last multiline array item. Found: '\''%count relationships were not created because they already exist.'\'' [23] => A comma should follow the last multiline array item. Found: '\''%count duplicate relationships'\'' [24] => A comma should follow the last multiline array item. Found: '\''civicrm_contact'\'' [25] => A comma should follow the last multiline array item. Found: '\''String'\'' [26] => A comma should follow the last multiline array item. Found: $cid_to_missing [27] => A comma should follow the last multiline array item. Found: '\''destination'\'' [28] => A comma should follow the last multiline array item. Found: '\''option_10'\'' [29] => A comma should follow the last multiline array item. Found: $group_id [30] => A comma should follow the last multiline array item. Found: 1 ) ' echo 'Lines:Array ( [0] => CRM/Campaign/BAO/Survey.php:452 [1] => CRM/Admin/Form/Options.php:98 [2] => CRM/Admin/Form/Options.php:135 [3] => CRM/Admin/Form/Options.php:176 [4] => CRM/Admin/Form/Options.php:307 [5] => CRM/Admin/Form/Options.php:355 [6] => CRM/Admin/Form/Options.php:458 [7] => CRM/Contact/Import/Form/DataSource.php:91 [8] => CRM/Profile/Form.php:364 [9] => CRM/Profile/Form.php:968 [10] => CRM/Profile/Form.php:973 [11] => CRM/Profile/Form.php:979 [12] => CRM/Core/OptionValue.php:306 [13] => CRM/Activity/Selector/Activity.php:224 [14] => CRM/Activity/Selector/Activity.php:244 [15] => CRM/Activity/Selector/Activity.php:260 [16] => CRM/Activity/Selector/Activity.php:275 [17] => CRM/Activity/Selector/Activity.php:287 [18] => CRM/Core/PseudoConstant.php:1738 [19] => CRM/Contact/Form/Task/SMSCommon.php:165 [20] => CRM/Contact/Form/Task/SMSCommon.php:172 [21] => CRM/Contact/Form/Task/SMSCommon.php:411 [22] => CRM/Contact/Form/Task/SMSCommon.php:425 [23] => CRM/Contact/Form/Task/SMSCommon.php:447 [24] => CRM/Price/Form/Preview.php:76 [25] => CRM/Price/Form/Preview.php:89 [26] => CRM/Core/Config.php:661 [27] => CRM/Logging/ReportDetail.php:77 [28] => CRM/Logging/ReportDetail.php:81 [29] => CRM/Logging/ReportDetail.php:85 [30] => CRM/Logging/ReportDetail.php:89 [31] => CRM/Core/Page.php:189 [32] => CRM/Contact/Form/Relationship.php:355 [33] => CRM/Contact/Form/Relationship.php:474 [34] => CRM/Contact/Form/Relationship.php:480 [35] => CRM/Contact/Form/Relationship.php:483 [36] => CRM/Contact/Form/Relationship.php:489 [37] => CRM/Contact/Form/Relationship.php:492 [38] => CRM/Core/BAO/Tag.php:130 [39] => CRM/Core/BAO/Tag.php:440 [40] => CRM/Core/BAO/Tag.php:441 [41] => tests/phpunit/WebTest/Admin/MoveCustomDataTest.php:86 [42] => tests/phpunit/WebTest/Admin/MoveCustomDataTest.php:90 [43] => tests/phpunit/WebTest/Admin/MoveCustomDataTest.php:283 [44] => tests/phpunit/WebTest/Admin/MoveCustomDataTest.php:406 [45] => tests/phpunit/WebTest/Admin/MoveCustomDataTest.php:453 [46] => CRM/Activity/Form/Activity.php:181 [47] => CRM/Activity/Form/Activity.php:190 ) ' echo '' echo 'Total number of edits to perform: 48' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/BAO/Survey.php' 452 edit_at_line 'CRM/Admin/Form/Options.php' 98 edit_at_line 'CRM/Admin/Form/Options.php' 135 edit_at_line 'CRM/Admin/Form/Options.php' 176 edit_at_line 'CRM/Admin/Form/Options.php' 307 edit_at_line 'CRM/Admin/Form/Options.php' 355 edit_at_line 'CRM/Admin/Form/Options.php' 458 edit_at_line 'CRM/Contact/Import/Form/DataSource.php' 91 edit_at_line 'CRM/Profile/Form.php' 364 edit_at_line 'CRM/Profile/Form.php' 968 edit_at_line 'CRM/Profile/Form.php' 973 edit_at_line 'CRM/Profile/Form.php' 979 edit_at_line 'CRM/Core/OptionValue.php' 306 edit_at_line 'CRM/Activity/Selector/Activity.php' 224 edit_at_line 'CRM/Activity/Selector/Activity.php' 244 edit_at_line 'CRM/Activity/Selector/Activity.php' 260 edit_at_line 'CRM/Activity/Selector/Activity.php' 275 edit_at_line 'CRM/Activity/Selector/Activity.php' 287 edit_at_line 'CRM/Core/PseudoConstant.php' 1738 edit_at_line 'CRM/Contact/Form/Task/SMSCommon.php' 165 edit_at_line 'CRM/Contact/Form/Task/SMSCommon.php' 172 edit_at_line 'CRM/Contact/Form/Task/SMSCommon.php' 411 edit_at_line 'CRM/Contact/Form/Task/SMSCommon.php' 425 edit_at_line 'CRM/Contact/Form/Task/SMSCommon.php' 447 edit_at_line 'CRM/Price/Form/Preview.php' 76 edit_at_line 'CRM/Price/Form/Preview.php' 89 edit_at_line 'CRM/Core/Config.php' 661 edit_at_line 'CRM/Logging/ReportDetail.php' 77 edit_at_line 'CRM/Logging/ReportDetail.php' 81 edit_at_line 'CRM/Logging/ReportDetail.php' 85 edit_at_line 'CRM/Logging/ReportDetail.php' 89 edit_at_line 'CRM/Core/Page.php' 189 edit_at_line 'CRM/Contact/Form/Relationship.php' 355 edit_at_line 'CRM/Contact/Form/Relationship.php' 474 edit_at_line 'CRM/Contact/Form/Relationship.php' 480 edit_at_line 'CRM/Contact/Form/Relationship.php' 483 edit_at_line 'CRM/Contact/Form/Relationship.php' 489 edit_at_line 'CRM/Contact/Form/Relationship.php' 492 edit_at_line 'CRM/Core/BAO/Tag.php' 130 edit_at_line 'CRM/Core/BAO/Tag.php' 440 edit_at_line 'CRM/Core/BAO/Tag.php' 441 edit_at_line 'tests/phpunit/WebTest/Admin/MoveCustomDataTest.php' 86 edit_at_line 'tests/phpunit/WebTest/Admin/MoveCustomDataTest.php' 90 edit_at_line 'tests/phpunit/WebTest/Admin/MoveCustomDataTest.php' 283 edit_at_line 'tests/phpunit/WebTest/Admin/MoveCustomDataTest.php' 406 edit_at_line 'tests/phpunit/WebTest/Admin/MoveCustomDataTest.php' 453 edit_at_line 'CRM/Activity/Form/Activity.php' 181 edit_at_line 'CRM/Activity/Form/Activity.php' 190 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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/WebTest/Contact/CreateCmsUserFromContactTest.php:42 [1] => tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php:61 [2] => tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php:82 [3] => tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php:105 [4] => tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php:129 [5] => tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php:181 [6] => tests/phpunit/WebTest/Import/DateFormatTest.php:41 [7] => tests/phpunit/WebTest/Import/DateFormatTest.php:56 [8] => tests/phpunit/WebTest/Import/DateFormatTest.php:72 [9] => tests/phpunit/WebTest/Import/DateFormatTest.php:93 [10] => tests/phpunit/WebTest/Import/DateFormatTest.php:114 [11] => tests/phpunit/WebTest/Import/DateFormatTest.php:135 ) ' echo '' echo 'Total number of edits to perform: 12' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php' 42 edit_at_line 'tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php' 61 edit_at_line 'tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php' 82 edit_at_line 'tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php' 105 edit_at_line 'tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php' 129 edit_at_line 'tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php' 181 edit_at_line 'tests/phpunit/WebTest/Import/DateFormatTest.php' 41 edit_at_line 'tests/phpunit/WebTest/Import/DateFormatTest.php' 56 edit_at_line 'tests/phpunit/WebTest/Import/DateFormatTest.php' 72 edit_at_line 'tests/phpunit/WebTest/Import/DateFormatTest.php' 93 edit_at_line 'tests/phpunit/WebTest/Import/DateFormatTest.php' 114 edit_at_line 'tests/phpunit/WebTest/Import/DateFormatTest.php' 135 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' 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/Contact/Import/Form/DataSource.php:59 [1] => CRM/Contact/Import/Form/DataSource.php:142 [2] => CRM/Contact/Import/Form/DataSource.php:290 [3] => CRM/Core/PseudoConstant.php:264 [4] => CRM/Core/PseudoConstant.php:326 [5] => CRM/Core/PseudoConstant.php:556 [6] => CRM/Core/Config.php:214 [7] => CRM/Logging/ReportDetail.php:108 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Import/Form/DataSource.php' 59 edit_at_line 'CRM/Contact/Import/Form/DataSource.php' 142 edit_at_line 'CRM/Contact/Import/Form/DataSource.php' 290 edit_at_line 'CRM/Core/PseudoConstant.php' 264 edit_at_line 'CRM/Core/PseudoConstant.php' 326 edit_at_line 'CRM/Core/PseudoConstant.php' 556 edit_at_line 'CRM/Core/Config.php' 214 edit_at_line 'CRM/Logging/ReportDetail.php' 108 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => sizeof() is a function name alias, use count() instead ) ' echo 'Lines:Array ( [0] => CRM/Profile/Form.php:985 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Profile/Form.php' 985 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $links does not match actual variable name $orderBy [1] => Doc comment for parameter $optionValueIDHas does not match actual variable name $optionValueID [2] => Doc comment for parameter $isActiveDo does not match actual variable name $isActive [3] => Doc comment for parameter $latitude does not match actual variable name $tablePrefix ) ' echo 'Lines:Array ( [0] => CRM/Core/OptionValue.php:65 [1] => CRM/Core/OptionValue.php:179 [2] => CRM/Core/OptionValue.php:384 [3] => CRM/Contact/BAO/ProximityQuery.php:210 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/OptionValue.php' 65 edit_at_line 'CRM/Core/OptionValue.php' 179 edit_at_line 'CRM/Core/OptionValue.php' 384 edit_at_line 'CRM/Contact/BAO/ProximityQuery.php' 210 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Campaign/Form/Survey/Results.php:80 [1] => CRM/Campaign/Form/Survey/Results.php:103 [2] => CRM/Campaign/Form/Survey/Results.php:347 [3] => CRM/Price/Form/Preview.php:58 [4] => CRM/Price/Form/Preview.php:98 [5] => CRM/Price/Form/Preview.php:127 [6] => CRM/Core/Config.php:672 [7] => CRM/Core/Config.php:673 [8] => CRM/Core/Page.php:265 [9] => CRM/Utils/ReCAPTCHA.php:56 [10] => api/v3/Im.php:79 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Campaign/Form/Survey/Results.php' 80 edit_at_line 'CRM/Campaign/Form/Survey/Results.php' 103 edit_at_line 'CRM/Campaign/Form/Survey/Results.php' 347 edit_at_line 'CRM/Price/Form/Preview.php' 58 edit_at_line 'CRM/Price/Form/Preview.php' 98 edit_at_line 'CRM/Price/Form/Preview.php' 127 edit_at_line 'CRM/Core/Config.php' 672 edit_at_line 'CRM/Core/Config.php' 673 edit_at_line 'CRM/Core/Page.php' 265 edit_at_line 'CRM/Utils/ReCAPTCHA.php' 56 edit_at_line 'api/v3/Im.php' 79 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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/Page.php:173 [1] => CRM/Contact/BAO/ContactType.php:637 [2] => CRM/Activity/Form/Activity.php:892 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Page.php' 173 edit_at_line 'CRM/Contact/BAO/ContactType.php' 637 edit_at_line 'CRM/Activity/Form/Activity.php' 892 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/Core/Page.php:245 [1] => CRM/Contact/BAO/ProximityQuery.php:371 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Page.php' 245 edit_at_line 'CRM/Contact/BAO/ProximityQuery.php' 371 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ReturnCommentIndentation' echo 'Messages:Array ( [0] => Return comment indentation must be 3 spaces, found 1 spaces [1] => Return comment indentation must be 3 spaces, found 2 spaces ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/EntityTag.php:49 [1] => api/v3/Attachment.php:301 [2] => api/v3/Attachment.php:302 [3] => api/v3/Attachment.php:303 [4] => api/v3/Attachment.php:304 [5] => api/v3/Attachment.php:305 [6] => api/v3/Attachment.php:306 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/EntityTag.php' 49 edit_at_line 'api/v3/Attachment.php' 301 edit_at_line 'api/v3/Attachment.php' 302 edit_at_line 'api/v3/Attachment.php' 303 edit_at_line 'api/v3/Attachment.php' 304 edit_at_line 'api/v3/Attachment.php' 305 edit_at_line 'api/v3/Attachment.php' 306 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' 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/Core/BAO/EntityTag.php:397 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/EntityTag.php' 397 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/Core/BAO/EntityTag.php:397 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/EntityTag.php' 397 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SeePunctuation!' 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/Contact/BAO/ProximityQuery.php:53 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/ProximityQuery.php' 53 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' 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/qunit/example/test.js:3 [1] => tests/qunit/example/test.js:5 [2] => tests/qunit/example/test.js:8 [3] => tests/qunit/example/test.js:10 ) ' echo '' echo 'Total number of edits to perform: 4' if ask_continue 'Edit these files?'; then edit_at_line 'tests/qunit/example/test.js' 3 edit_at_line 'tests/qunit/example/test.js' 5 edit_at_line 'tests/qunit/example/test.js' 8 edit_at_line 'tests/qunit/example/test.js' 10 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.CloseBracketSpacing.ClosingWhitespace' echo 'Messages:Array ( [0] => There should be no white space before a closing \")\" ) ' echo 'Lines:Array ( [0] => tests/qunit/example/test.js:5 [1] => tests/qunit/example/test.js:10 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'tests/qunit/example/test.js' 5 edit_at_line 'tests/qunit/example/test.js' 10 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.CloseBracketSpacing.ClosingWhitespace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.$InReturnType' echo 'Messages:Array ( [0] => @return data type must not contain \"$\" ) ' echo 'Lines:Array ( [0] => CRM/Activity/Form/Activity.php:1011 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Activity/Form/Activity.php' 1011 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.$InReturnType!' 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 10 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Case/Detail.php:516 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Case/Detail.php' 516 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' echo '' echo 'Yay!' echo '' fi