Name: RefactorTools
Owner: AOE
Description: null
Created: 2014-07-22 15:35:04.0
Updated: 2014-07-22 15:41:08.0
Pushed: 2014-07-24 09:34:21.0
Homepage: null
Size: 148
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This standalone PHP tool provides functionalities to refactor your code automatically.
You can easily install this tool via composer:
rl -s http://getcomposer.org/installer | php
p composer.phar install
The usage is easy. Just execute the refactor-tool.php and you will get a list of available commands.
p refactor-tool.php help
This command removes all “require” and “require_once” statements from your PHP class files. This is very helpful, if you have just implemented an autoloader and now want to clean up your code and make sure your autoloading is working correctly.
Note, that only files with a ".php" file extension and a PHP class definition inside will be touched.
This will show you the help of the autoloading refactoring functionality:
p refactor-tool.php autoloading help
Here is an example usage:
p refactor-tool.php autoloading /path/to/my/project
If you want to restrict the removals of requrie statements, you can use the “—restrict” option. This option requires a valid regular expression. If given, only statements will be removed, that matches against this pattern. Here is an example usage:
p refactor-tool.php autoloading /path/to/my/project --restrict '~my_pattern\-(.*)~'