#!/bin/bash ## usage: bash batch-8.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' echo 'Messages:Array ( [0] => A comma should follow the last multiline array item. Found: 1 [1] => A comma should follow the last multiline array item. Found: ] [2] => A comma should follow the last multiline array item. Found: '\''2'\'' [3] => A comma should follow the last multiline array item. Found: '\''$value.api.activity_type.create.values.0.value'\'' [4] => A comma should follow the last multiline array item. Found: ) [5] => A comma should follow the last multiline array item. Found: '\''AdvMulti-Select'\'' [6] => A comma should follow the last multiline array item. Found: '\''Multi-Select State/Province'\'' [7] => A comma should follow the last multiline array item. Found: '\''user_unique_id'\'' [8] => A comma should follow the last multiline array item. Found: '\''rty'\'' [9] => A comma should follow the last multiline array item. Found: '\''p[]'\'' [10] => A comma should follow the last multiline array item. Found: '\''_preRollback'\'' [11] => A comma should follow the last multiline array item. Found: '\''_postRollback'\'' [12] => A comma should follow the last multiline array item. Found: '\''ytr'\'' [13] => A comma should follow the last multiline array item. Found: '\''][p'\'' [14] => A comma should follow the last multiline array item. Found: '\''email'\'' [15] => A comma should follow the last multiline array item. Found: '\''postal_greeting'\'' [16] => A comma should follow the last multiline array item. Found: '\''deceased_date'\'' [17] => A comma should follow the last multiline array item. Found: '\''civicrm_membership'\'' [18] => A comma should follow the last multiline array item. Found: '\''eight'\'' [19] => A comma should follow the last multiline array item. Found: NULL [20] => A comma should follow the last multiline array item. Found: '\''street_unit'\'' [21] => A comma should follow the last multiline array item. Found: '\''new_household'\'' [22] => A comma should follow the last multiline array item. Found: $master_cid [23] => A comma should follow the last multiline array item. Found: '\''case/summary'\'' [24] => A comma should follow the last multiline array item. Found: '\''Household'\'' [25] => A comma should follow the last multiline array item. Found: '\''event_end_date_to'\'' [26] => A comma should follow the last multiline array item. Found: \"{$createIndexPrefix}_{$field}{$lengthName}\" ) ' echo 'Lines:Array ( [0] => tests/phpunit/api/v3/ActivityTest.php:347 [1] => tests/phpunit/api/v3/ActivityTest.php:376 [2] => tests/phpunit/api/v3/ActivityTest.php:412 [3] => tests/phpunit/api/v3/ActivityTest.php:595 [4] => tests/phpunit/api/v3/ActivityTest.php:603 [5] => tests/phpunit/api/v3/ActivityTest.php:636 [6] => tests/phpunit/api/v3/ActivityTest.php:895 [7] => tests/phpunit/api/v3/ActivityTest.php:919 [8] => tests/phpunit/api/v3/ActivityTest.php:1133 [9] => CRM/Dedupe/Merger.php:826 [10] => CRM/Dedupe/Merger.php:1433 [11] => CRM/Dedupe/Merger.php:1446 [12] => CRM/Dedupe/Merger.php:1620 [13] => tests/phpunit/CRM/Core/TransactionTest.php:208 [14] => tests/phpunit/CRM/Core/TransactionTest.php:212 [15] => tests/phpunit/CRM/Core/TransactionTest.php:216 [16] => tests/phpunit/CRM/Core/TransactionTest.php:220 [17] => tests/phpunit/CRM/Core/TransactionTest.php:236 [18] => tests/phpunit/CRM/Core/TransactionTest.php:240 [19] => tests/phpunit/CRM/Core/TransactionTest.php:244 [20] => tests/phpunit/CRM/Core/TransactionTest.php:248 [21] => CRM/Profile/Selector/Listings.php:344 [22] => CRM/Profile/Selector/Listings.php:555 [23] => CRM/Profile/Selector/Listings.php:668 [24] => CRM/Profile/Selector/Listings.php:675 [25] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:78 [26] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:105 [27] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:111 [28] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:115 [29] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:144 [30] => CRM/Contact/Form/Edit/Address.php:77 [31] => CRM/Contact/Form/Edit/Address.php:121 [32] => CRM/Contact/Form/Edit/Address.php:126 [33] => CRM/Contact/Form/Edit/Address.php:147 [34] => CRM/Contact/Form/Edit/Address.php:268 [35] => CRM/Contact/Form/Edit/Address.php:362 [36] => CRM/Contact/Form/Edit/Address.php:390 [37] => CRM/Contact/Form/Edit/Address.php:394 [38] => CRM/Upgrade/Incremental/php/ThreeFour.php:75 [39] => CRM/Upgrade/Incremental/php/ThreeFour.php:188 [40] => CRM/Upgrade/Incremental/php/ThreeFour.php:302 [41] => CRM/Core/BAO/SchemaHandler.php:443 ) ' echo '' echo 'Total number of edits to perform: 42' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 347 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 376 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 412 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 595 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 603 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 636 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 895 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 919 edit_at_line 'tests/phpunit/api/v3/ActivityTest.php' 1133 edit_at_line 'CRM/Dedupe/Merger.php' 826 edit_at_line 'CRM/Dedupe/Merger.php' 1433 edit_at_line 'CRM/Dedupe/Merger.php' 1446 edit_at_line 'CRM/Dedupe/Merger.php' 1620 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 208 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 212 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 216 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 220 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 236 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 240 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 244 edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 248 edit_at_line 'CRM/Profile/Selector/Listings.php' 344 edit_at_line 'CRM/Profile/Selector/Listings.php' 555 edit_at_line 'CRM/Profile/Selector/Listings.php' 668 edit_at_line 'CRM/Profile/Selector/Listings.php' 675 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 78 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 105 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 111 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 115 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 144 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 77 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 121 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 126 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 147 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 268 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 362 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 390 edit_at_line 'CRM/Contact/Form/Edit/Address.php' 394 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 75 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 188 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 302 edit_at_line 'CRM/Core/BAO/SchemaHandler.php' 443 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array!' echo '' echo 'Yay!' echo '' fi 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 8 spaces but found 10 [2] => Array indentation error, expected 10 spaces but found 12 [3] => Array indentation error, expected 14 spaces but found 16 [4] => Array indentation error, expected 12 spaces but found 14 [5] => Array indentation error, expected 4 spaces but found 6 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Pledge/Summary.php:50 [1] => CRM/Report/Form/Pledge/Summary.php:70 [2] => CRM/Report/Form/Pledge/Summary.php:71 [3] => CRM/Report/Form/Pledge/Summary.php:80 [4] => CRM/Report/Form/Pledge/Summary.php:81 [5] => CRM/Report/Form/Pledge/Summary.php:159 [6] => CRM/Report/Form/Pledge/Summary.php:160 [7] => CRM/Report/Form/Pledge/Summary.php:169 [8] => CRM/Dedupe/Merger.php:859 [9] => CRM/Dedupe/Merger.php:862 [10] => CRM/Financial/Page/AJAX.php:88 [11] => CRM/Financial/Page/AJAX.php:89 [12] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:325 [13] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:326 [14] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:327 [15] => tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php:328 [16] => CRM/Report/Form/Contribute/History.php:83 [17] => CRM/Report/Form/Contribute/History.php:112 [18] => CRM/Report/Form/Contribute/History.php:113 [19] => CRM/Report/Form/Contribute/History.php:122 [20] => CRM/Report/Form/Contribute/History.php:123 [21] => CRM/Report/Form/Contribute/History.php:132 [22] => CRM/Report/Form/Campaign/SurveyDetails.php:102 [23] => CRM/Report/Form/Campaign/SurveyDetails.php:103 [24] => CRM/Report/Form/Campaign/SurveyDetails.php:960 [25] => CRM/Report/Form/Campaign/SurveyDetails.php:962 [26] => CRM/Upgrade/Incremental/php/ThreeFour.php:357 [27] => CRM/Upgrade/Incremental/php/ThreeFour.php:358 ) ' echo '' echo 'Total number of edits to perform: 28' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 50 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 70 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 71 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 80 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 81 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 159 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 160 edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 169 edit_at_line 'CRM/Dedupe/Merger.php' 859 edit_at_line 'CRM/Dedupe/Merger.php' 862 edit_at_line 'CRM/Financial/Page/AJAX.php' 88 edit_at_line 'CRM/Financial/Page/AJAX.php' 89 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 325 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 326 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 327 edit_at_line 'tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php' 328 edit_at_line 'CRM/Report/Form/Contribute/History.php' 83 edit_at_line 'CRM/Report/Form/Contribute/History.php' 112 edit_at_line 'CRM/Report/Form/Contribute/History.php' 113 edit_at_line 'CRM/Report/Form/Contribute/History.php' 122 edit_at_line 'CRM/Report/Form/Contribute/History.php' 123 edit_at_line 'CRM/Report/Form/Contribute/History.php' 132 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 102 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 103 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 960 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 962 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 357 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 358 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 8 spaces but found 10 [2] => Array closing indentation error, expected 12 spaces but found 14 [3] => Array closing indentation error, expected 2 spaces but found 4 ) ' echo 'Lines:Array ( [0] => CRM/Report/Form/Pledge/Summary.php:170 [1] => CRM/Financial/Page/AJAX.php:90 [2] => CRM/Report/Form/Contribute/History.php:133 [3] => CRM/Report/Form/Campaign/SurveyDetails.php:103 [4] => CRM/Upgrade/Incremental/php/ThreeFour.php:359 ) ' echo '' echo 'Total number of edits to perform: 5' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Report/Form/Pledge/Summary.php' 170 edit_at_line 'CRM/Financial/Page/AJAX.php' 90 edit_at_line 'CRM/Report/Form/Contribute/History.php' 133 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 103 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 359 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Array.Array.ArrayClosingIndentation!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.ParamNameNoMatch' echo 'Messages:Array ( [0] => Doc comment for parameter $autoFlipWether does not match actual variable name $redirectForPerformance [1] => Doc comment for parameter $url does not match actual variable name $htmlUrl ) ' echo 'Lines:Array ( [0] => CRM/Dedupe/Merger.php:566 [1] => CRM/Dedupe/Merger.php:611 [2] => CRM/Utils/String.php:774 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Dedupe/Merger.php' 566 edit_at_line 'CRM/Dedupe/Merger.php' 611 edit_at_line 'CRM/Utils/String.php' 774 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/Dedupe/Merger.php:1635 [1] => CRM/Utils/String.php:54 [2] => CRM/Profile/Selector/Listings.php:134 [3] => CRM/Contribute/Form/CancelSubscription.php:189 [4] => CRM/Core/IDS.php:55 [5] => CRM/Utils/Tree.php:149 [6] => CRM/Utils/Tree.php:179 [7] => CRM/Utils/Tree.php:195 [8] => CRM/Utils/Tree.php:196 [9] => CRM/Utils/Tree.php:215 [10] => CRM/Utils/Tree.php:226 ) ' echo '' echo 'Total number of edits to perform: 11' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Dedupe/Merger.php' 1635 edit_at_line 'CRM/Utils/String.php' 54 edit_at_line 'CRM/Profile/Selector/Listings.php' 134 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 189 edit_at_line 'CRM/Core/IDS.php' 55 edit_at_line 'CRM/Utils/Tree.php' 149 edit_at_line 'CRM/Utils/Tree.php' 179 edit_at_line 'CRM/Utils/Tree.php' 195 edit_at_line 'CRM/Utils/Tree.php' 196 edit_at_line 'CRM/Utils/Tree.php' 215 edit_at_line 'CRM/Utils/Tree.php' 226 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.MissingParamName!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.InvalidReturn' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for function return type ) ' echo 'Lines:Array ( [0] => CRM/Utils/String.php:212 [1] => CRM/Utils/String.php:315 [2] => CRM/Utils/String.php:345 [3] => CRM/Utils/String.php:394 [4] => CRM/Utils/String.php:413 [5] => CRM/Utils/String.php:740 [6] => CRM/Core/IDS.php:57 [7] => CRM/Core/IDS.php:182 [8] => CRM/Core/IDS.php:213 [9] => CRM/Utils/Tree.php:152 ) ' echo '' echo 'Total number of edits to perform: 10' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/String.php' 212 edit_at_line 'CRM/Utils/String.php' 315 edit_at_line 'CRM/Utils/String.php' 345 edit_at_line 'CRM/Utils/String.php' 394 edit_at_line 'CRM/Utils/String.php' 413 edit_at_line 'CRM/Utils/String.php' 740 edit_at_line 'CRM/Core/IDS.php' 57 edit_at_line 'CRM/Core/IDS.php' 182 edit_at_line 'CRM/Core/IDS.php' 213 edit_at_line 'CRM/Utils/Tree.php' 152 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturn!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Squiz.Scope.MethodScope.Missing' echo 'Messages:Array ( [0] => Visibility must be declared on method \"stripPathChars\" [1] => Visibility must be declared on method \"__construct\" [2] => Visibility must be declared on method \"url\" [3] => Visibility must be declared on method \"remoteCall\" [4] => Visibility must be declared on method \"call\" [5] => Visibility must be declared on method \"ping\" [6] => Visibility must be declared on method \"errorMsg\" [7] => Visibility must be declared on method \"init\" [8] => Visibility must be declared on method \"webtestNewDialogContact\" [9] => Visibility must be declared on method \"webtestAddContributionPage\" [10] => Visibility must be declared on method \"_testAddFinancialAccount\" [11] => Visibility must be declared on method \"_testEditFinancialAccount\" [12] => Visibility must be declared on method \"preProcess\" [13] => Visibility must be declared on method \"invoke\" ) ' echo 'Lines:Array ( [0] => CRM/Utils/String.php:574 [1] => CRM/Profile/Selector/Listings.php:142 [2] => CRM/Utils/System/UnitTests.php:185 [3] => api/class.api.php:84 [4] => api/class.api.php:168 [5] => api/class.api.php:217 [6] => api/class.api.php:251 [7] => api/class.api.php:267 [8] => api/class.api.php:274 [9] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:711 [10] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:1070 [11] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:1735 [12] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:1826 [13] => CRM/Grant/Form/Task.php:77 [14] => CRM/Contribute/Form/Task/Email.php:64 [15] => CRM/Utils/Hook/Joomla.php:70 ) ' echo '' echo 'Total number of edits to perform: 16' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/String.php' 574 edit_at_line 'CRM/Profile/Selector/Listings.php' 142 edit_at_line 'CRM/Utils/System/UnitTests.php' 185 edit_at_line 'api/class.api.php' 84 edit_at_line 'api/class.api.php' 168 edit_at_line 'api/class.api.php' 217 edit_at_line 'api/class.api.php' 251 edit_at_line 'api/class.api.php' 267 edit_at_line 'api/class.api.php' 274 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 711 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 1070 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 1735 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 1826 edit_at_line 'CRM/Grant/Form/Task.php' 77 edit_at_line 'CRM/Contribute/Form/Task/Email.php' 64 edit_at_line 'CRM/Utils/Hook/Joomla.php' 70 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/phpunit/CRM/Core/TransactionTest.php:398 [1] => CRM/Utils/System/UnitTests.php:318 [2] => CRM/Core/BAO/SchemaHandler.php:369 ) ' echo '' echo 'Total number of edits to perform: 3' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Core/TransactionTest.php' 398 edit_at_line 'CRM/Utils/System/UnitTests.php' 318 edit_at_line 'CRM/Core/BAO/SchemaHandler.php' 369 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidNoReturn!' 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/Financial/Page/AJAX.php:264 [1] => CRM/Financial/Page/AJAX.php:293 [2] => CRM/Financial/Page/AJAX.php:310 [3] => CRM/Financial/Page/AJAX.php:453 [4] => CRM/Financial/Page/AJAX.php:487 [5] => CRM/Financial/Page/AJAX.php:515 [6] => CRM/Profile/Selector/Listings.php:277 [7] => CRM/Profile/Selector/Listings.php:774 [8] => CRM/Profile/Selector/Listings.php:795 [9] => CRM/Report/Form/Contribute/History.php:626 [10] => CRM/Report/Form/Contribute/History.php:684 [11] => CRM/Contribute/Form/CancelSubscription.php:128 [12] => CRM/Contribute/Form/CancelSubscription.php:230 [13] => CRM/Contribute/Form/CancelSubscription.php:247 [14] => CRM/Contribute/Form/CancelSubscription.php:249 [15] => CRM/Contribute/Form/CancelSubscription.php:280 [16] => CRM/Contribute/Form/CancelSubscription.php:293 [17] => CRM/Report/Form/Campaign/SurveyDetails.php:415 [18] => CRM/Report/Form/Campaign/SurveyDetails.php:492 [19] => CRM/Report/Form/Campaign/SurveyDetails.php:873 [20] => CRM/Report/Form/Contribute/SoftCredit.php:422 ) ' echo '' echo 'Total number of edits to perform: 21' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Financial/Page/AJAX.php' 264 edit_at_line 'CRM/Financial/Page/AJAX.php' 293 edit_at_line 'CRM/Financial/Page/AJAX.php' 310 edit_at_line 'CRM/Financial/Page/AJAX.php' 453 edit_at_line 'CRM/Financial/Page/AJAX.php' 487 edit_at_line 'CRM/Financial/Page/AJAX.php' 515 edit_at_line 'CRM/Profile/Selector/Listings.php' 277 edit_at_line 'CRM/Profile/Selector/Listings.php' 774 edit_at_line 'CRM/Profile/Selector/Listings.php' 795 edit_at_line 'CRM/Report/Form/Contribute/History.php' 626 edit_at_line 'CRM/Report/Form/Contribute/History.php' 684 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 128 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 230 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 247 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 249 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 280 edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 293 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 415 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 492 edit_at_line 'CRM/Report/Form/Campaign/SurveyDetails.php' 873 edit_at_line 'CRM/Report/Form/Contribute/SoftCredit.php' 422 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.MultiLineAssignment!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.WhiteSpace.ScopeIndent.Incorrect' echo 'Messages:Array ( [0] => Line indented incorrectly; expected 4 spaces, found 6 ) ' echo 'Lines:Array ( [0] => tests/phpunit/CRM/Core/Config/MailerTest.php:59 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 59 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.WhiteSpace.ScopeIndent.Incorrect!' 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] => tests/phpunit/CRM/Core/Config/MailerTest.php:60 [1] => tests/phpunit/CRM/Core/Config/MailerTest.php:61 [2] => tests/phpunit/CRM/Core/Config/MailerTest.php:62 [3] => tests/phpunit/CRM/Core/Config/MailerTest.php:68 [4] => tests/phpunit/CRM/Core/Config/MailerTest.php:69 [5] => tests/phpunit/CRM/Core/Config/MailerTest.php:70 [6] => tests/phpunit/CRM/Core/Config/MailerTest.php:71 [7] => tests/phpunit/CRM/Core/Config/MailerTest.php:72 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 60 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 61 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 62 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 68 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 69 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 70 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 71 edit_at_line 'tests/phpunit/CRM/Core/Config/MailerTest.php' 72 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/UnitTests.php:62 [1] => CRM/Utils/System/UnitTests.php:106 [2] => CRM/Utils/System/UnitTests.php:110 [3] => CRM/Utils/System/UnitTests.php:125 [4] => CRM/Utils/System/UnitTests.php:148 [5] => CRM/Utils/System/UnitTests.php:273 ) ' echo '' echo 'Total number of edits to perform: 6' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/UnitTests.php' 62 edit_at_line 'CRM/Utils/System/UnitTests.php' 106 edit_at_line 'CRM/Utils/System/UnitTests.php' 110 edit_at_line 'CRM/Utils/System/UnitTests.php' 125 edit_at_line 'CRM/Utils/System/UnitTests.php' 148 edit_at_line 'CRM/Utils/System/UnitTests.php' 273 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.PHP.NonExecutableCode.ReturnNotRequired!' 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/Utils/System/UnitTests.php:148 [1] => CRM/Core/IDS.php:64 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/System/UnitTests.php' 148 edit_at_line 'CRM/Core/IDS.php' 64 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.InvalidReturnNotVoid!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.ControlStructures.InlineControlStructure.NotAllowed' echo 'Messages:Array ( [0] => Inline control structures are not allowed ) ' echo 'Lines:Array ( [0] => CRM/Contribute/Form/CancelSubscription.php:331 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Contribute/Form/CancelSubscription.php' 331 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.ControlStructures.InlineControlStructure.NotAllowed!' 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/Core/IDS.php:164 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/IDS.php' 164 echo '===============================================================' echo '' echo 'Completed formatting issue Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Formatting.SpaceInlineIf.SpacingAfter' echo 'Messages:Array ( [0] => Expected 1 space after \"?\"; newline found [1] => Expected 1 space after \":\"; newline found ) ' echo 'Lines:Array ( [0] => CRM/Core/IDS.php:218 [1] => CRM/Core/IDS.php:219 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Core/IDS.php' 218 edit_at_line 'CRM/Core/IDS.php' 219 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Formatting.SpaceInlineIf.SpacingAfter!' 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] => api/class.api.php:185 [1] => api/class.api.php:200 [2] => CRM/Upgrade/Incremental/php/ThreeFour.php:152 [3] => CRM/Upgrade/Incremental/php/ThreeFour.php:222 [4] => CRM/Core/BAO/SchemaHandler.php:82 [5] => CRM/Core/BAO/SchemaHandler.php:351 [6] => CRM/Core/BAO/SchemaHandler.php:413 [7] => CRM/Core/BAO/SchemaHandler.php:468 ) ' echo '' echo 'Total number of edits to perform: 8' if ask_continue 'Edit these files?'; then edit_at_line 'api/class.api.php' 185 edit_at_line 'api/class.api.php' 200 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 152 edit_at_line 'CRM/Upgrade/Incremental/php/ThreeFour.php' 222 edit_at_line 'CRM/Core/BAO/SchemaHandler.php' 82 edit_at_line 'CRM/Core/BAO/SchemaHandler.php' 351 edit_at_line 'CRM/Core/BAO/SchemaHandler.php' 413 edit_at_line 'CRM/Core/BAO/SchemaHandler.php' 468 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] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:811 [1] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:1629 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 811 edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 1629 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.SpacingAfter!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Semantics.FunctionAlias.FunctionAlias' echo 'Messages:Array ( [0] => fputs() is a function name alias, use fwrite() instead ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:939 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 939 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Semantics.FunctionAlias.FunctionAlias!' echo '' echo 'Yay!' echo '' fi echo '===============================================================' echo 'Formatting issue: Drupal.Commenting.FunctionComment.IncorrectParamVarName' echo 'Messages:Array ( [0] => Expected \"bool\" but found \"boolean\" for parameter type ) ' echo 'Lines:Array ( [0] => tests/phpunit/CiviTest/CiviSeleniumTestCase.php:1652 ) ' echo '' echo 'Total number of edits to perform: 1' if ask_continue 'Edit these files?'; then edit_at_line 'tests/phpunit/CiviTest/CiviSeleniumTestCase.php' 1652 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.IncorrectParamVarName!' 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] => CRM/Utils/Tree.php:116 [1] => CRM/Utils/SoapServer.php:150 ) ' echo '' echo 'Total number of edits to perform: 2' if ask_continue 'Edit these files?'; then edit_at_line 'CRM/Utils/Tree.php' 116 edit_at_line 'CRM/Utils/SoapServer.php' 150 echo '===============================================================' echo '' echo 'Completed formatting issue Drupal.Commenting.FunctionComment.WrongStyle!' echo '' echo 'Yay!' echo '' fi