#!/bin/bash ## usage: bash batch-9.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/Custom/Form/Group.php:72 [1] => CRM/Custom/Form/Group.php:177 [2] => CRM/Custom/Form/Group.php:189 [3] => CRM/Custom/Form/Group.php:408 [4] => CRM/Custom/Form/Group.php:460 [5] => CRM/Core/Error.php:60 [6] => CRM/Core/Error.php:170 [7] => CRM/Core/Error.php:464 [8] => CRM/Core/Error.php:465 [9] => CRM/Core/Error.php:466 [10] => CRM/Core/Error.php:467 [11] => CRM/Core/Error.php:468 [12] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:904 [13] => CRM/Utils/System/DrupalBase.php:62 [14] => CRM/Utils/System/DrupalBase.php:95 [15] => CRM/Utils/System/DrupalBase.php:482 [16] => CRM/Custom/Form/Option.php:70 [17] => CRM/Custom/Form/Option.php:106 [18] => CRM/Custom/Form/Option.php:154 [19] => CRM/Custom/Form/Option.php:395 [20] => api/v3/Contact.php:144 [21] => CRM/Core/Controller.php:384 [22] => CRM/Core/Controller.php:385 ) ' echo '' echo 'Total number of edits to perform: 23' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Custom/Form/Group.php' 72 edit_at_line 'CRM/Custom/Form/Group.php' 177 edit_at_line 'CRM/Custom/Form/Group.php' 189 edit_at_line 'CRM/Custom/Form/Group.php' 408 edit_at_line 'CRM/Custom/Form/Group.php' 460 edit_at_line 'CRM/Core/Error.php' 60 edit_at_line 'CRM/Core/Error.php' 170 edit_at_line 'CRM/Core/Error.php' 464 edit_at_line 'CRM/Core/Error.php' 465 edit_at_line 'CRM/Core/Error.php' 466 edit_at_line 'CRM/Core/Error.php' 467 edit_at_line 'CRM/Core/Error.php' 468 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 904 edit_at_line 'CRM/Utils/System/DrupalBase.php' 62 edit_at_line 'CRM/Utils/System/DrupalBase.php' 95 edit_at_line 'CRM/Utils/System/DrupalBase.php' 482 edit_at_line 'CRM/Custom/Form/Option.php' 70 edit_at_line 'CRM/Custom/Form/Option.php' 106 edit_at_line 'CRM/Custom/Form/Option.php' 154 edit_at_line 'CRM/Custom/Form/Option.php' 395 edit_at_line 'api/v3/Contact.php' 144 edit_at_line 'CRM/Core/Controller.php' 384 edit_at_line 'CRM/Core/Controller.php' 385 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' 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: \"-- Any --\" [2] => A comma should follow the last multiline array item. Found: $org [3] => A comma should follow the last multiline array item. Found: '\''%count relationships were not created because the contact is not of the right type for this relationship'\'' [4] => A comma should follow the last multiline array item. Found: '\''Relationships created.'\'' [5] => A comma should follow the last multiline array item. Found: $locale [6] => A comma should follow the last multiline array item. Found: CREATE_NEW [7] => A comma should follow the last multiline array item. Found: '\''CRM_Member_Form_Membership'\'' [8] => A comma should follow the last multiline array item. Found: '\''onbehalf_dupe_alert'\'' [9] => A comma should follow the last multiline array item. Found: '\''cms:view user account'\'' [10] => A comma should follow the last multiline array item. Found: 1 ) ' echo 'Lines:Array ( [0] => CRM/Custom/Form/Group.php:260 [1] => CRM/Custom/Form/Group.php:265 [2] => CRM/Custom/Form/Group.php:279 [3] => CRM/Contact/Form/Task/AddToOrganization.php:66 [4] => CRM/Contact/Form/Task/AddToOrganization.php:169 [5] => CRM/Contact/Form/Task/AddToOrganization.php:170 [6] => CRM/Contact/Form/Task/AddToOrganization.php:177 [7] => CRM/Contact/Form/Task/AddToOrganization.php:183 [8] => CRM/Contact/Form/Task/AddToOrganization.php:189 [9] => CRM/Core/I18n/Schema.php:565 [10] => CRM/Core/I18n/Schema.php:596 [11] => CRM/Core/Block.php:244 [12] => CRM/Core/Block.php:332 [13] => CRM/Core/Block.php:372 [14] => CRM/Core/Block.php:395 [15] => CRM/Core/Block.php:405 [16] => CRM/Core/Block.php:416 [17] => CRM/Core/Block.php:484 [18] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:781 [19] => CRM/Core/Payment/GoogleIPN.php:306 [20] => CRM/Utils/System/DrupalBase.php:281 [21] => tests/phpunit/api/v3/PledgeTest.php:282 [22] => CRM/Contribute/BAO/Query.php:879 [23] => CRM/Contribute/BAO/Query.php:893 [24] => CRM/Contribute/BAO/Query.php:906 [25] => CRM/Core/Page/Angular.php:74 [26] => CRM/Core/Page/Angular.php:80 [27] => CRM/Core/Page/Angular.php:84 [28] => CRM/Core/Page/Angular.php:90 [29] => CRM/Core/Page/Angular.php:95 [30] => CRM/Core/Page/Angular.php:99 [31] => CRM/Core/Page/Angular.php:103 ) ' echo '' echo 'Total number of edits to perform: 32' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Custom/Form/Group.php' 260 edit_at_line 'CRM/Custom/Form/Group.php' 265 edit_at_line 'CRM/Custom/Form/Group.php' 279 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 66 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 169 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 170 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 177 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 183 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 189 edit_at_line 'CRM/Core/I18n/Schema.php' 565 edit_at_line 'CRM/Core/I18n/Schema.php' 596 edit_at_line 'CRM/Core/Block.php' 244 edit_at_line 'CRM/Core/Block.php' 332 edit_at_line 'CRM/Core/Block.php' 372 edit_at_line 'CRM/Core/Block.php' 395 edit_at_line 'CRM/Core/Block.php' 405 edit_at_line 'CRM/Core/Block.php' 416 edit_at_line 'CRM/Core/Block.php' 484 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 781 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 306 edit_at_line 'CRM/Utils/System/DrupalBase.php' 281 edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 282 edit_at_line 'CRM/Contribute/BAO/Query.php' 879 edit_at_line 'CRM/Contribute/BAO/Query.php' 893 edit_at_line 'CRM/Contribute/BAO/Query.php' 906 edit_at_line 'CRM/Core/Page/Angular.php' 74 edit_at_line 'CRM/Core/Page/Angular.php' 80 edit_at_line 'CRM/Core/Page/Angular.php' 84 edit_at_line 'CRM/Core/Page/Angular.php' 90 edit_at_line 'CRM/Core/Page/Angular.php' 95 edit_at_line 'CRM/Core/Page/Angular.php' 99 edit_at_line 'CRM/Core/Page/Angular.php' 103 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Utils/OptionBag.php:65 [1] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:255 [2] => CRM/Contact/BAO/GroupNesting.php:341 [3] => CRM/Contact/BAO/GroupNesting.php:361 [4] => CRM/Contact/BAO/GroupNesting.php:382 [5] => CRM/Contact/BAO/GroupNesting.php:404 [6] => CRM/Contact/BAO/GroupNesting.php:436 [7] => CRM/Contact/BAO/GroupNesting.php:470 [8] => CRM/Contact/BAO/GroupNesting.php:511 [9] => CRM/Core/Controller.php:666 [10] => CRM/Core/Controller.php:687 [11] => CRM/Core/Controller.php:743 [12] => CRM/Core/Selector/Controller.php:261 [13] => CRM/Core/Selector/Controller.php:499 [14] => CRM/Core/Selector/Controller.php:520 [15] => CRM/Core/Lock.php:151 [16] => api/api.php:92 ) ' echo '' echo 'Total number of edits to perform: 17' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/OptionBag.php' 65 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 255 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 341 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 361 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 382 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 404 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 436 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 470 edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 511 edit_at_line 'CRM/Core/Controller.php' 666 edit_at_line 'CRM/Core/Controller.php' 687 edit_at_line 'CRM/Core/Controller.php' 743 edit_at_line 'CRM/Core/Selector/Controller.php' 261 edit_at_line 'CRM/Core/Selector/Controller.php' 499 edit_at_line 'CRM/Core/Selector/Controller.php' 520 edit_at_line 'CRM/Core/Lock.php' 151 edit_at_line 'api/api.php' 92 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' 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/OptionBag.php:67 [1] => CRM/Utils/OptionBag.php:68 [2] => CRM/Utils/OptionBag.php:69 [3] => CRM/Utils/OptionBag.php:128 [4] => CRM/Utils/OptionBag.php:140 [5] => CRM/Utils/OptionBag.php:141 [6] => CRM/Utils/OptionBag.php:142 [7] => CRM/Utils/System/DrupalBase.php:66 [8] => CRM/Utils/System/DrupalBase.php:67 [9] => CRM/Utils/System/DrupalBase.php:68 [10] => api/v3/Membership.php:49 [11] => api/v3/Membership.php:66 [12] => api/v3/Mailing.php:44 ) ' echo '' echo 'Total number of edits to perform: 13' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/OptionBag.php' 67 edit_at_line 'CRM/Utils/OptionBag.php' 68 edit_at_line 'CRM/Utils/OptionBag.php' 69 edit_at_line 'CRM/Utils/OptionBag.php' 128 edit_at_line 'CRM/Utils/OptionBag.php' 140 edit_at_line 'CRM/Utils/OptionBag.php' 141 edit_at_line 'CRM/Utils/OptionBag.php' 142 edit_at_line 'CRM/Utils/System/DrupalBase.php' 66 edit_at_line 'CRM/Utils/System/DrupalBase.php' 67 edit_at_line 'CRM/Utils/System/DrupalBase.php' 68 edit_at_line 'api/v3/Membership.php' 49 edit_at_line 'api/v3/Membership.php' 66 edit_at_line 'api/v3/Mailing.php' 44 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.ReturnCommentIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"debug_var\" [1] => Visibility must be declared on method \"singleton\" [2] => Visibility must be declared on method \"install\" [3] => Visibility must be declared on method \"uninstall\" [4] => Visibility must be declared on method \"disable\" [5] => Visibility must be declared on method \"enable\" [6] => Visibility must be declared on method \"doDirectPayment\" [7] => Visibility must be declared on method \"checkConfig\" [8] => Visibility must be declared on method \"makeSinglelingualTable\" [9] => Visibility must be declared on method \"paypal\" [10] => Visibility must be declared on method \"google\" [11] => Visibility must be declared on method \"csv\" [12] => Visibility must be declared on method \"process\" [13] => Visibility must be declared on method \"buildPriceSet\" [14] => Visibility must be declared on method \"checkCurrentMembership\" [15] => Visibility must be declared on method \"setDefaultPriceSet\" [16] => Visibility must be declared on method \"copy\" [17] => Visibility must be declared on method \"checkPermission\" [18] => Visibility must be declared on method \"url\" [19] => Visibility must be declared on method \"__construct\" [20] => Visibility must be declared on method \"columns\" [21] => Visibility must be declared on method \"invoke\" ) ' echo 'Lines:Array ( [0] => CRM/Core/Error.php:529 [1] => tests/extensions/test.extension.manager.paymenttest/main.php:23 [2] => tests/extensions/test.extension.manager.paymenttest/main.php:33 [3] => tests/extensions/test.extension.manager.paymenttest/main.php:37 [4] => tests/extensions/test.extension.manager.paymenttest/main.php:41 [5] => tests/extensions/test.extension.manager.paymenttest/main.php:45 [6] => tests/extensions/test.extension.manager.paymenttest/main.php:60 [7] => tests/extensions/test.extension.manager.paymenttest/main.php:63 [8] => CRM/Core/I18n/Schema.php:169 [9] => bin/ContributionProcessor.php:146 [10] => bin/ContributionProcessor.php:252 [11] => bin/ContributionProcessor.php:325 [12] => bin/ContributionProcessor.php:368 [13] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:770 [14] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:847 [15] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:881 [16] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:928 [17] => CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php:975 [18] => CRM/Utils/System/DrupalBase.php:169 [19] => CRM/Core/Controller.php:178 [20] => CRM/Core/I18n/SchemaStructure_3_1_alpha1.php:39 [21] => CRM/Utils/Hook/DrupalBase.php:78 ) ' echo '' echo 'Total number of edits to perform: 22' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Error.php' 529 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 23 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 33 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 37 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 41 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 45 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 60 edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 63 edit_at_line 'CRM/Core/I18n/Schema.php' 169 edit_at_line 'bin/ContributionProcessor.php' 146 edit_at_line 'bin/ContributionProcessor.php' 252 edit_at_line 'bin/ContributionProcessor.php' 325 edit_at_line 'bin/ContributionProcessor.php' 368 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 770 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 847 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 881 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 928 edit_at_line 'CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php' 975 edit_at_line 'CRM/Utils/System/DrupalBase.php' 169 edit_at_line 'CRM/Core/Controller.php' 178 edit_at_line 'CRM/Core/I18n/SchemaStructure_3_1_alpha1.php' 39 edit_at_line 'CRM/Utils/Hook/DrupalBase.php' 78 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.Scope.MethodScope.Missing!' 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] => tests/extensions/test.extension.manager.paymenttest/main.php:56 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/extensions/test.extension.manager.paymenttest/main.php' 56 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/Contact/Form/Task/AddToOrganization.php:90 [1] => CRM/Contact/Form/Task/AddToOrganization.php:97 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 90 edit_at_line 'CRM/Contact/Form/Task/AddToOrganization.php' 97 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' 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/Core/I18n/Schema.php:124 [1] => CRM/Core/I18n/Schema.php:134 [2] => CRM/Core/I18n/Schema.php:175 [3] => CRM/Core/I18n/Schema.php:215 [4] => CRM/Core/I18n/Schema.php:321 [5] => bin/ContributionProcessor.php:189 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/I18n/Schema.php' 124 edit_at_line 'CRM/Core/I18n/Schema.php' 134 edit_at_line 'CRM/Core/I18n/Schema.php' 175 edit_at_line 'CRM/Core/I18n/Schema.php' 215 edit_at_line 'CRM/Core/I18n/Schema.php' 321 edit_at_line 'bin/ContributionProcessor.php' 189 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Classes.ClassCreateInstance!' 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] => bin/ContributionProcessor.php:144 [1] => bin/ContributionProcessor.php:250 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'bin/ContributionProcessor.php' 144 edit_at_line 'bin/ContributionProcessor.php' 250 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.ControlStructures.ForEachLoopDeclaration.SpacingBeforeAs' echo 'Messages:Array ( [0] => Expected 1 space before \"as\"; 17 found ) ' echo 'Lines:Array ( [0] => bin/ContributionProcessor.php:285 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'bin/ContributionProcessor.php' 285 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.ControlStructures.ForEachLoopDeclaration.SpacingBeforeAs!' 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/Block.php:593 [1] => CRM/Contribute/BAO/Query.php:1041 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Block.php' 593 edit_at_line 'CRM/Contribute/BAO/Query.php' 1041 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Formatting.MultiLineAssignment' echo 'Messages:Array ( [0] => Multi-line assignments must have the equal sign on the second line ) ' echo 'Lines:Array ( [0] => CRM/Core/Payment/GoogleIPN.php:494 [1] => CRM/Custom/Form/Option.php:428 [2] => CRM/Custom/Form/Option.php:459 [3] => CRM/Custom/Form/Option.php:474 [4] => CRM/Report/Form/Contact/Relationship.php:590 [5] => CRM/Report/Form/Contact/Relationship.php:605 [6] => CRM/Report/Form/Contact/Relationship.php:616 [7] => CRM/Core/Controller.php:198 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 494 edit_at_line 'CRM/Custom/Form/Option.php' 428 edit_at_line 'CRM/Custom/Form/Option.php' 459 edit_at_line 'CRM/Custom/Form/Option.php' 474 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 590 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 605 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 616 edit_at_line 'CRM/Core/Controller.php' 198 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.ControlStructures.SwitchDeclaration.SpaceBeforeColonCase' echo 'Messages:Array ( [0] => There must be no space before the colon in a CASE statement ) ' echo 'Lines:Array ( [0] => CRM/Core/Payment/GoogleIPN.php:588 [1] => CRM/Core/Payment/GoogleIPN.php:594 [2] => CRM/Core/Payment/GoogleIPN.php:620 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 588 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 594 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 620 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.ControlStructures.SwitchDeclaration.SpaceBeforeColonCase!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeClosingBrace.BreakIdent' echo 'Messages:Array ( [0] => Case breaking statement indented incorrectly; expected 8 spaces, found 6 ) ' echo 'Lines:Array ( [0] => CRM/Core/Payment/GoogleIPN.php:592 [1] => CRM/Core/Payment/GoogleIPN.php:618 [2] => CRM/Core/Payment/GoogleIPN.php:647 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 592 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 618 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 647 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeClosingBrace.BreakIdent!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeSecond' echo 'Messages:Array ( [0] => Space found before second semicolon of FOR loop ) ' echo 'Lines:Array ( [0] => CRM/Contact/BAO/GroupNesting.php:161 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contact/BAO/GroupNesting.php' 161 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeSecond!' 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/PledgeTest.php:106 [1] => tests/phpunit/api/v3/PledgeTest.php:190 [2] => tests/phpunit/api/v3/PledgeTest.php:213 [3] => tests/phpunit/api/v3/PledgeTest.php:270 [4] => tests/phpunit/api/v3/PledgeTest.php:338 [5] => tests/phpunit/api/v3/PledgeTest.php:472 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 106 edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 190 edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 213 edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 270 edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 338 edit_at_line 'tests/phpunit/api/v3/PledgeTest.php' 472 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayIndentation' echo 'Messages:Array ( [0] => Array indentation error, expected 10 spaces but found 6 [1] => Array indentation error, expected 6 spaces but found 4 [2] => Array indentation error, expected 6 spaces but found 8 [3] => Array indentation error, expected 12 spaces but found 10 [4] => Array indentation error, expected 14 spaces but found 16 [5] => Array indentation error, expected 12 spaces but found 14 ) ' echo 'Lines:Array ( [0] => api/v3/Contact.php:72 [1] => api/v3/Contact.php:83 [2] => api/v3/Contact.php:84 [3] => api/v3/Contact.php:85 [4] => api/v3/Contact.php:822 [5] => CRM/Report/Form/Contact/Relationship.php:226 [6] => CRM/Report/Form/Contact/Relationship.php:227 [7] => CRM/Report/Form/Contact/Relationship.php:228 [8] => CRM/Report/Form/Contact/Summary.php:57 [9] => CRM/Report/Form/Contact/Summary.php:132 [10] => CRM/Report/Form/Contact/Summary.php:133 [11] => CRM/Report/Form/Contact/Summary.php:147 [12] => CRM/Report/Form/Contact/Summary.php:148 [13] => CRM/Report/Form/Contact/Summary.php:157 ) ' echo '' echo 'Total number of edits to perform: 14' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Contact.php' 72 edit_at_line 'api/v3/Contact.php' 83 edit_at_line 'api/v3/Contact.php' 84 edit_at_line 'api/v3/Contact.php' 85 edit_at_line 'api/v3/Contact.php' 822 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 226 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 227 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 228 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 57 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 132 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 133 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 147 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 148 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 157 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Array.Array.ArrayClosingIndentation' echo 'Messages:Array ( [0] => Array closing indentation error, expected 4 spaces but found 6 [1] => Array closing indentation error, expected 12 spaces but found 14 ) ' echo 'Lines:Array ( [0] => api/v3/Contact.php:86 [1] => CRM/Report/Form/Contact/Relationship.php:227 [2] => CRM/Report/Form/Contact/Summary.php:158 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Contact.php' 86 edit_at_line 'CRM/Report/Form/Contact/Relationship.php' 227 edit_at_line 'CRM/Report/Form/Contact/Summary.php' 158 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OperatorSpacing.SpacingAfter' echo 'Messages:Array ( [0] => Expected 1 space after \"=\"; 2 found [1] => Expected 1 space after \"=>\"; 2 found ) ' echo 'Lines:Array ( [0] => CRM/Contribute/BAO/Query.php:141 [1] => api/v3/Membership.php:221 [2] => api/v3/Mailing.php:576 [3] => api/v3/Mailing.php:582 [4] => api/v3/Mailing.php:588 [5] => api/v3/Mailing.php:594 [6] => api/v3/Mailing.php:600 ) ' echo '' echo 'Total number of edits to perform: 7' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Query.php' 141 edit_at_line 'api/v3/Membership.php' 221 edit_at_line 'api/v3/Mailing.php' 576 edit_at_line 'api/v3/Mailing.php' 582 edit_at_line 'api/v3/Mailing.php' 588 edit_at_line 'api/v3/Mailing.php' 594 edit_at_line 'api/v3/Mailing.php' 600 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.OperatorSpacing.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace' echo 'Messages:Array ( [0] => There should be no white space after an opening \"(\" [1] => There should be no white space after an opening \"{\" ) ' echo 'Lines:Array ( [0] => CRM/Contribute/BAO/Query.php:365 [1] => CRM/Utils/Signer.php:102 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Query.php' 365 edit_at_line 'CRM/Utils/Signer.php' 102 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] => CRM/Contribute/BAO/Query.php:365 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/BAO/Query.php' 365 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.CloseBracketSpacing.ClosingWhitespace!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.IncorrectExact' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 2 spaces, found 4 [1] => Line indented incorrectly; expected 4 spaces, found 6 ) ' echo 'Lines:Array ( [0] => api/v3/Membership.php:115 [1] => api/v3/Membership.php:117 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Membership.php' 115 edit_at_line 'api/v3/Membership.php' 117 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.IncorrectExact!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.Incorrect' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 2 spaces, found 4 ) ' echo 'Lines:Array ( [0] => api/v3/Membership.php:116 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Membership.php' 116 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.Incorrect!' 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/Membership.php:205 [1] => api/v3/Mailing.php:209 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'api/v3/Membership.php' 205 edit_at_line 'api/v3/Mailing.php' 209 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.Comma.NoSpace!' echo '' echo 'Yay!' echo '' fi