#!/bin/bash ## usage: bash batch-5.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.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 6 spaces but found 8 [1] => Array indentation error, expected 10 spaces but found 12 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Activity.php:65 [1] => CRM/Report/Form/Activity.php:144 [2] => CRM/Report/Form/Activity.php:145 [3] => CRM/Report/Form/Activity.php:171 [4] => CRM/Report/Form/Activity.php:172 [5] => CRM/Report/Form/Activity.php:245 [6] => CRM/Report/Form/Activity.php:246 [7] => CRM/Report/Form/Activity.php:250 [8] => CRM/Report/Form/Activity.php:251 [9] => CRM/Report/Form/Activity.php:274 [10] => CRM/Report/Form/Activity.php:275 [11] => CRM/Report/Form/Activity.php:303 [12] => CRM/Report/Form/Contribute/Sybunt.php:66 [13] => CRM/Report/Form/Contribute/Sybunt.php:93 [14] => CRM/Report/Form/Contribute/Sybunt.php:94 [15] => CRM/Report/Form/Contribute/Sybunt.php:103 [16] => CRM/Report/Form/Contribute/Sybunt.php:104 [17] => CRM/Report/Form/Contribute/Sybunt.php:113 [18] => CRM/Report/Form/Contribute/Summary.php:64 [19] => CRM/Report/Form/Contribute/Summary.php:90 [20] => CRM/Report/Form/Contribute/Summary.php:91 [21] => CRM/Report/Form/Contribute/Summary.php:100 [22] => CRM/Report/Form/Contribute/Summary.php:101 [23] => CRM/Report/Form/Contribute/Summary.php:110 [24] => CRM/Report/Form/Contribute/Summary.php:111 [25] => CRM/Report/Form/Contribute/Summary.php:118 [26] => CRM/Report/Form/Contribute/Summary.php:119 [27] => CRM/Report/Form/Contribute/Summary.php:197 [28] => CRM/Report/Form/Contribute/Summary.php:198 [29] => CRM/Report/Form/Contribute/Summary.php:242 [30] => CRM/ACL/Form/ACL.php:159 [31] => CRM/ACL/Form/ACL.php:160 [32] => CRM/ACL/Form/ACL.php:165 [33] => CRM/ACL/Form/ACL.php:166 [34] => CRM/ACL/Form/ACL.php:170 [35] => CRM/ACL/Form/ACL.php:171 [36] => CRM/ACL/Form/ACL.php:175 [37] => CRM/ACL/Form/ACL.php:176 [38] => CRM/ACL/Form/ACL.php:180 [39] => CRM/ACL/Form/ACL.php:181 [40] => CRM/Event/BAO/Event.php:947 ) ' echo '' echo 'Total number of edits to perform: 41' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Activity.php' 65 edit_at_line 'CRM/Report/Form/Activity.php' 144 edit_at_line 'CRM/Report/Form/Activity.php' 145 edit_at_line 'CRM/Report/Form/Activity.php' 171 edit_at_line 'CRM/Report/Form/Activity.php' 172 edit_at_line 'CRM/Report/Form/Activity.php' 245 edit_at_line 'CRM/Report/Form/Activity.php' 246 edit_at_line 'CRM/Report/Form/Activity.php' 250 edit_at_line 'CRM/Report/Form/Activity.php' 251 edit_at_line 'CRM/Report/Form/Activity.php' 274 edit_at_line 'CRM/Report/Form/Activity.php' 275 edit_at_line 'CRM/Report/Form/Activity.php' 303 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 66 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 93 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 94 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 103 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 104 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 113 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 64 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 90 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 91 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 100 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 101 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 110 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 111 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 118 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 119 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 197 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 198 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 242 edit_at_line 'CRM/ACL/Form/ACL.php' 159 edit_at_line 'CRM/ACL/Form/ACL.php' 160 edit_at_line 'CRM/ACL/Form/ACL.php' 165 edit_at_line 'CRM/ACL/Form/ACL.php' 166 edit_at_line 'CRM/ACL/Form/ACL.php' 170 edit_at_line 'CRM/ACL/Form/ACL.php' 171 edit_at_line 'CRM/ACL/Form/ACL.php' 175 edit_at_line 'CRM/ACL/Form/ACL.php' 176 edit_at_line 'CRM/ACL/Form/ACL.php' 180 edit_at_line 'CRM/ACL/Form/ACL.php' 181 edit_at_line 'CRM/Event/BAO/Event.php' 947 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array' echo 'Messages:Array ( [0] => A comma should follow the last multiline array item. Found: ) [1] => A comma should follow the last multiline array item. Found: '\''street_number_suffix'\'' [2] => A comma should follow the last multiline array item. Found: '\''master_id'\'' [3] => A comma should follow the last multiline array item. Found: '\''world_region'\'' [4] => A comma should follow the last multiline array item. Found: '\''fr_CA'\'' [5] => A comma should follow the last multiline array item. Found: '\''Person'\'' [6] => A comma should follow the last multiline array item. Found: '\''Excluder'\'' [7] => A comma should follow the last multiline array item. Found: ] [8] => A comma should follow the last multiline array item. Found: \"Update\" [9] => A comma should follow the last multiline array item. Found: \"Insert\" [10] => A comma should follow the last multiline array item. Found: \"Delete\" [11] => A comma should follow the last multiline array item. Found: \"Added\" [12] => A comma should follow the last multiline array item. Found: \"Removed\" [13] => A comma should follow the last multiline array item. Found: \"{$lastName}, {$firstName}\" [14] => A comma should follow the last multiline array item. Found: \"{$firstName} {$lastName}\" [15] => A comma should follow the last multiline array item. Found: \"Delete (to trash)\" [16] => A comma should follow the last multiline array item. Found: '\''tmp'\'' [17] => A comma should follow the last multiline array item. Found: '\''Could not determine if MySQL has InnoDB support. Assuming none.'\'' [18] => A comma should follow the last multiline array item. Found: '\''wordpress'\'' ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Activity.php:273 [1] => CRM/Report/Form/Activity.php:302 [2] => CRM/Core/BAO/Address.php:382 [3] => CRM/Core/BAO/Address.php:426 [4] => CRM/Core/BAO/Address.php:511 [5] => CRM/Core/BAO/Address.php:757 [6] => CRM/Core/BAO/Address.php:851 [7] => tests/phpunit/api/v3/MailingTest.php:85 [8] => tests/phpunit/api/v3/MailingTest.php:89 [9] => tests/phpunit/api/v3/MailingTest.php:93 [10] => tests/phpunit/api/v3/MailingTest.php:97 [11] => tests/phpunit/api/v3/MailingTest.php:182 [12] => tests/phpunit/api/v3/MailingTest.php:190 [13] => tests/phpunit/api/v3/MailingTest.php:194 [14] => tests/phpunit/api/v3/MailingTest.php:198 [15] => tests/phpunit/api/v3/MailingTest.php:244 [16] => tests/phpunit/api/v3/MailingTest.php:269 [17] => tests/phpunit/api/v3/MailingTest.php:274 [18] => tests/phpunit/api/v3/MailingTest.php:279 [19] => tests/phpunit/api/v3/MailingTest.php:283 [20] => tests/phpunit/api/v3/MailingTest.php:287 [21] => tests/phpunit/api/v3/MailingTest.php:291 [22] => tests/phpunit/WebTest/Report/LoggingReportTest.php:192 [23] => tests/phpunit/WebTest/Report/LoggingReportTest.php:197 [24] => tests/phpunit/WebTest/Report/LoggingReportTest.php:202 [25] => tests/phpunit/WebTest/Report/LoggingReportTest.php:208 [26] => tests/phpunit/WebTest/Report/LoggingReportTest.php:213 [27] => tests/phpunit/WebTest/Report/LoggingReportTest.php:224 [28] => tests/phpunit/WebTest/Report/LoggingReportTest.php:231 [29] => tests/phpunit/WebTest/Report/LoggingReportTest.php:236 [30] => tests/phpunit/WebTest/Report/LoggingReportTest.php:242 [31] => tests/phpunit/WebTest/Report/LoggingReportTest.php:247 [32] => tests/phpunit/WebTest/Report/LoggingReportTest.php:258 [33] => tests/phpunit/WebTest/Report/LoggingReportTest.php:263 [34] => tests/phpunit/WebTest/Report/LoggingReportTest.php:316 [35] => tests/phpunit/WebTest/Report/LoggingReportTest.php:317 [36] => CRM/Mailing/MailStore.php:161 [37] => CRM/Event/Badge/Logo5395.php:47 [38] => Civi/Install/Requirements.php:285 [39] => CRM/Core/CodeGen/Config.php:21 ) ' echo '' echo 'Total number of edits to perform: 40' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Activity.php' 273 edit_at_line 'CRM/Report/Form/Activity.php' 302 edit_at_line 'CRM/Core/BAO/Address.php' 382 edit_at_line 'CRM/Core/BAO/Address.php' 426 edit_at_line 'CRM/Core/BAO/Address.php' 511 edit_at_line 'CRM/Core/BAO/Address.php' 757 edit_at_line 'CRM/Core/BAO/Address.php' 851 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 85 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 89 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 93 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 97 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 182 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 190 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 194 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 198 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 244 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 269 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 274 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 279 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 283 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 287 edit_at_line 'tests/phpunit/api/v3/MailingTest.php' 291 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 192 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 197 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 202 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 208 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 213 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 224 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 231 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 236 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 242 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 247 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 258 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 263 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 316 edit_at_line 'tests/phpunit/WebTest/Report/LoggingReportTest.php' 317 edit_at_line 'CRM/Mailing/MailStore.php' 161 edit_at_line 'CRM/Event/Badge/Logo5395.php' 47 edit_at_line 'Civi/Install/Requirements.php' 285 edit_at_line 'CRM/Core/CodeGen/Config.php' 21 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' 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 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Activity.php:304 [1] => CRM/Report/Form/Contribute/Sybunt.php:114 [2] => CRM/Report/Form/Contribute/Summary.php:243 [3] => CRM/ACL/Form/ACL.php:161 [4] => CRM/ACL/Form/ACL.php:167 [5] => CRM/ACL/Form/ACL.php:172 [6] => CRM/ACL/Form/ACL.php:177 [7] => CRM/ACL/Form/ACL.php:182 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Activity.php' 304 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 114 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 243 edit_at_line 'CRM/ACL/Form/ACL.php' 161 edit_at_line 'CRM/ACL/Form/ACL.php' 167 edit_at_line 'CRM/ACL/Form/ACL.php' 172 edit_at_line 'CRM/ACL/Form/ACL.php' 177 edit_at_line 'CRM/ACL/Form/ACL.php' 182 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.DocComment.ContentAfterOpen' echo 'Messages:Array ( [0] => The open comment tag must be the only content on the line ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Activity.php:347 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Activity.php' 347 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.ContentAfterOpen!' 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/Activity.php:566 [1] => CRM/Report/Form/Contribute/Sybunt.php:318 [2] => CRM/Report/Form/Contribute/Sybunt.php:379 [3] => CRM/Report/Form/Contribute/Sybunt.php:415 [4] => CRM/Report/Form/Contribute/Sybunt.php:451 [5] => CRM/Report/Form/Contribute/Sybunt.php:454 [6] => CRM/Report/Form/Contribute/Sybunt.php:457 [7] => CRM/Report/Form/Contribute/Sybunt.php:460 [8] => CRM/Core/BAO/Address.php:367 [9] => CRM/Core/BAO/Address.php:897 [10] => CRM/Core/BAO/Address.php:1037 [11] => CRM/Report/Form/Contribute/Summary.php:319 [12] => CRM/Report/Form/Contribute/Summary.php:549 [13] => CRM/Report/Form/Contribute/Summary.php:556 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Activity.php' 566 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 318 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 379 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 415 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 451 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 454 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 457 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 460 edit_at_line 'CRM/Core/BAO/Address.php' 367 edit_at_line 'CRM/Core/BAO/Address.php' 897 edit_at_line 'CRM/Core/BAO/Address.php' 1037 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 319 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 549 edit_at_line 'CRM/Report/Form/Contribute/Summary.php' 556 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' 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/Sybunt.php:115 [1] => CRM/Report/Form/Contribute/Sybunt.php:116 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 115 edit_at_line 'CRM/Report/Form/Contribute/Sybunt.php' 116 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OperatorSpacing.SpacingBefore!' 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/BAO/Address.php:57 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Address.php' 57 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' 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/Core/BAO/Address.php:408 [1] => CRM/Core/BAO/Address.php:1254 [2] => CRM/Utils/System/Joomla.php:703 [3] => CRM/Event/BAO/Event.php:1888 [4] => api/v3/GroupContact.php:163 [5] => CRM/Core/BAO/CustomValue.php:50 [6] => CRM/Utils/Geocode/Google.php:63 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Address.php' 408 edit_at_line 'CRM/Core/BAO/Address.php' 1254 edit_at_line 'CRM/Utils/System/Joomla.php' 703 edit_at_line 'CRM/Event/BAO/Event.php' 1888 edit_at_line 'api/v3/GroupContact.php' 163 edit_at_line 'CRM/Core/BAO/CustomValue.php' 50 edit_at_line 'CRM/Utils/Geocode/Google.php' 63 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.MissingParamName' echo 'Messages:Array ( [0] => Missing parameter name ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/Address.php:715 [1] => CRM/Core/BAO/Address.php:716 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Address.php' 715 edit_at_line 'CRM/Core/BAO/Address.php' 716 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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/Address.php:1250 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Address.php' 1250 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/Address.php:1250 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Address.php' 1250 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SeePunctuation!' 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 ) ' echo 'Lines:Array ( [0] => CRM/Core/BAO/Address.php:1297 [1] => CRM/Event/BAO/Event.php:2221 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/BAO/Address.php' 1297 edit_at_line 'CRM/Event/BAO/Event.php' 2221 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!' 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/Utils/System/Joomla.php:198 [1] => CRM/Utils/System/Joomla.php:232 [2] => CRM/Utils/System/Joomla.php:243 [3] => CRM/Utils/System/Joomla.php:431 [4] => CRM/Utils/System/Joomla.php:592 [5] => bin/cli.class.php:403 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/Joomla.php' 198 edit_at_line 'CRM/Utils/System/Joomla.php' 232 edit_at_line 'CRM/Utils/System/Joomla.php' 243 edit_at_line 'CRM/Utils/System/Joomla.php' 431 edit_at_line 'CRM/Utils/System/Joomla.php' 592 edit_at_line 'bin/cli.class.php' 403 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 \"url\" [1] => Visibility must be declared on method \"getEvents\" [2] => Visibility must be declared on method \"getCompleteInfo\" [3] => Visibility must be declared on method \"buildCustomDisplay\" [4] => Visibility must be declared on method \"buildCustomProfile\" [5] => Visibility must be declared on method \"__construct\" [6] => Visibility must be declared on method \"run\" [7] => Visibility must be declared on method \"convertLine\" [8] => Visibility must be declared on method \"processline\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/System/Joomla.php:363 [1] => CRM/Event/BAO/Event.php:263 [2] => CRM/Event/BAO/Event.php:728 [3] => CRM/Event/BAO/Event.php:1263 [4] => CRM/Event/BAO/Event.php:1727 [5] => bin/cli.class.php:321 [6] => bin/cli.class.php:326 [7] => bin/cli.class.php:365 [8] => bin/cli.class.php:371 [9] => bin/cli.class.php:412 [10] => bin/cli.class.php:436 [11] => bin/cli.class.php:456 ) ' echo '' echo 'Total number of edits to perform: 12' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/Joomla.php' 363 edit_at_line 'CRM/Event/BAO/Event.php' 263 edit_at_line 'CRM/Event/BAO/Event.php' 728 edit_at_line 'CRM/Event/BAO/Event.php' 1263 edit_at_line 'CRM/Event/BAO/Event.php' 1727 edit_at_line 'bin/cli.class.php' 321 edit_at_line 'bin/cli.class.php' 326 edit_at_line 'bin/cli.class.php' 365 edit_at_line 'bin/cli.class.php' 371 edit_at_line 'bin/cli.class.php' 412 edit_at_line 'bin/cli.class.php' 436 edit_at_line 'bin/cli.class.php' 456 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Classes.ClassCreateInstance' echo 'Messages:Array ( [0] => Calling class constructors must always include parentheses ) ' echo 'Lines:Array ( [0] => CRM/Utils/System/Joomla.php:412 [1] => CRM/Utils/System/Joomla.php:520 [2] => CRM/Utils/System/Joomla.php:633 [3] => CRM/Utils/System/Joomla.php:678 [4] => CRM/Mailing/MailStore.php:50 [5] => CRM/Mailing/MailStore.php:131 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/Joomla.php' 412 edit_at_line 'CRM/Utils/System/Joomla.php' 520 edit_at_line 'CRM/Utils/System/Joomla.php' 633 edit_at_line 'CRM/Utils/System/Joomla.php' 678 edit_at_line 'CRM/Mailing/MailStore.php' 50 edit_at_line 'CRM/Mailing/MailStore.php' 131 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' 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] => CRM/Utils/System/Joomla.php:427 [1] => CRM/Utils/System/Joomla.php:842 [2] => CRM/Utils/System/Joomla.php:843 [3] => CRM/Utils/System/Joomla.php:844 [4] => api/v3/GroupContact.php:88 [5] => api/v3/GroupContact.php:89 [6] => api/v3/GroupContact.php:98 [7] => api/v3/GroupContact.php:100 [8] => api/v3/GroupContact.php:101 [9] => api/v3/GroupContact.php:105 [10] => api/v3/GroupContact.php:106 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/Joomla.php' 427 edit_at_line 'CRM/Utils/System/Joomla.php' 842 edit_at_line 'CRM/Utils/System/Joomla.php' 843 edit_at_line 'CRM/Utils/System/Joomla.php' 844 edit_at_line 'api/v3/GroupContact.php' 88 edit_at_line 'api/v3/GroupContact.php' 89 edit_at_line 'api/v3/GroupContact.php' 98 edit_at_line 'api/v3/GroupContact.php' 100 edit_at_line 'api/v3/GroupContact.php' 101 edit_at_line 'api/v3/GroupContact.php' 105 edit_at_line 'api/v3/GroupContact.php' 106 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $considerStatusConsider does not match actual variable name $role [1] => Doc comment for parameter $statusConsider does not match actual variable name $role [2] => Doc comment for parameter $considerRoleConsider does not match actual variable name $role [3] => Doc comment for parameter $roleConsider does not match actual variable name $role [4] => Doc comment for parameter $typeGet does not match actual variable name $onlyPublic [5] => Doc comment for parameter $eventIdReturn does not match actual variable name $onlyPublic [6] => Doc comment for parameter $onlyPublicInclude does not match actual variable name $onlyPublic ) ' echo 'Lines:Array ( [0] => CRM/Event/BAO/Event.php:582 [1] => CRM/Event/BAO/Event.php:584 [2] => CRM/Event/BAO/Event.php:586 [3] => CRM/Event/BAO/Event.php:588 [4] => CRM/Event/BAO/Event.php:716 [5] => CRM/Event/BAO/Event.php:718 [6] => CRM/Event/BAO/Event.php:722 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Event/BAO/Event.php' 582 edit_at_line 'CRM/Event/BAO/Event.php' 584 edit_at_line 'CRM/Event/BAO/Event.php' 586 edit_at_line 'CRM/Event/BAO/Event.php' 588 edit_at_line 'CRM/Event/BAO/Event.php' 716 edit_at_line 'CRM/Event/BAO/Event.php' 718 edit_at_line 'CRM/Event/BAO/Event.php' 722 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ParamNameNoMatch!' 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] => bin/cli.class.php:33 [1] => bin/cli.class.php:38 [2] => bin/cli.class.php:315 [3] => bin/cli.class.php:358 [4] => bin/cli.class.php:431 [5] => bin/cli.class.php:451 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'bin/cli.class.php' 33 edit_at_line 'bin/cli.class.php' 38 edit_at_line 'bin/cli.class.php' 315 edit_at_line 'bin/cli.class.php' 358 edit_at_line 'bin/cli.class.php' 431 edit_at_line 'bin/cli.class.php' 451 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.DocComment.WrongEnd!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Generic.PHP.UpperCaseConstant.Found' echo 'Messages:Array ( [0] => TRUE, FALSE and NULL must be uppercase; expected \"NULL\" but found \"null\" ) ' echo 'Lines:Array ( [0] => api/v3/GroupContact.php:223 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/GroupContact.php' 223 echo '===============================================================' echo '' echo 'Completed formatting issue Generic.PHP.UpperCaseConstant.Found!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.Comma.NoSpace' echo 'Messages:Array ( [0] => Expected one space after the comma, 0 found ) ' echo 'Lines:Array ( [0] => api/v3/GroupContact.php:224 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/GroupContact.php' 224 edit_at_line 'api/v3/GroupContact.php' 224 edit_at_line 'api/v3/GroupContact.php' 224 edit_at_line 'api/v3/GroupContact.php' 224 edit_at_line 'api/v3/GroupContact.php' 224 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.NoSpace!' echo '' echo 'Yay!' echo '' fi