|
| 1 | +*phprefactor.txt* refactoring tools for PHP |
| 2 | + |
| 3 | + PHP REFACTORING SUPPORT FOR VIM |
| 4 | + (requires https://github.com/QafooLabs/php-refactoring-browser) |
| 5 | + |
| 6 | +================================================================================ |
| 7 | +CONTENTS *PhpRefactorContents* |
| 8 | + |
| 9 | +1. Setup ............................. |PhpRefactorSetup| |
| 10 | +2. Usage ............................. |PhpRefactorUsage| |
| 11 | +3. Mappings .......................... |PhpRefactorMappings| |
| 12 | +4. License ........................... |PhpRefactorLicense| |
| 13 | +5. Contributing ...................... |PhpRefactorContrib| |
| 14 | + |
| 15 | +================================================================================ |
| 16 | +SETUP *PhpRefactorSetup* |
| 17 | + |
| 18 | +Before you can use this plugin you will need to download php-refactoring-browser |
| 19 | +from https://github.com/QafooLabs/php-refactoring-browser |
| 20 | + |
| 21 | +Next you will need to put refactor.phar some where safe and add the following |
| 22 | +config to your .vimrc |
| 23 | + |
| 24 | +let g:php_refactor_command='php /path/to/refactor.phar' |
| 25 | + |
| 26 | +This plugin also requires the patch command so I'm not sure if it will work on |
| 27 | +Windows. |
| 28 | + |
| 29 | +================================================================================ |
| 30 | +USAGE *PhpRefactorUsage* |
| 31 | + |
| 32 | +Once this application is installed you can simply use the |PhpRefactorMappings| |
| 33 | +mappings in PHP files to perform the various refactorings. |
| 34 | + |
| 35 | +================================================================================ |
| 36 | +MAPPINGS *PhpRefactorMappings* |
| 37 | + |
| 38 | +- EXTRACT METHOD |
| 39 | + Go into visual mode and select the code you want to extract to a new |
| 40 | + method the press <Leader>rem |
| 41 | + |
| 42 | + You will be prompted for the name of the new method. |
| 43 | + |
| 44 | +- RENAME LOCAL VARIABLE |
| 45 | + In normal mode move the cursor so it's inside the name of the variable |
| 46 | + which you want to rename. Press <Leader>rlv |
| 47 | + |
| 48 | + You will be prompted for the new name of the variable. |
| 49 | + |
| 50 | +- LOCAL VARIABLE TO INSTANCE VARIABLE |
| 51 | + In normal mode move the cursor so it's inside the name of the variable |
| 52 | + which you want to rename. Press <Leader>rli |
| 53 | + |
| 54 | +- OPTIMIZE USE |
| 55 | + Simple press <Leader>rou to run the optimize use refactoring. |
| 56 | + |
| 57 | +================================================================================ |
| 58 | +LICENSE *PhpRefactorLicense* |
| 59 | + |
| 60 | +The MIT License (MIT) |
| 61 | + |
| 62 | +Copyright (c) 2013 Tom Oram |
| 63 | + |
| 64 | +Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 65 | +this software and associated documentation files (the "Software"), to deal in |
| 66 | +the Software without restriction, including without limitation the rights to |
| 67 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 68 | +the Software, and to permit persons to whom the Software is furnished to do so, |
| 69 | +subject to the following conditions: |
| 70 | + |
| 71 | +The above copyright notice and this permission notice shall be included in all |
| 72 | +copies or substantial portions of the Software. |
| 73 | + |
| 74 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 75 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 76 | +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 77 | +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 78 | +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 79 | +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 80 | + |
| 81 | +================================================================================ |
| 82 | +CONTRIBUTING *PhpRefactorContrib* |
| 83 | + |
| 84 | +To contribute to this plugin simply fork the GitHub repository at |
| 85 | +http://github.com/tomphp/vim-php-refactoring |
| 86 | + |
| 87 | +To contribute to the refactoring engine fork the GitHub repository |
| 88 | +https://github.com/QafooLabs/php-refactoring-browser |
0 commit comments