AOEpeople/RefactorTools

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Refactoring Tools

This standalone PHP tool provides functionalities to refactor your code automatically.

Installation

You can easily install this tool via composer:

rl -s http://getcomposer.org/installer | php
p composer.phar install
Basic Usage

The usage is easy. Just execute the refactor-tool.php and you will get a list of available commands.

p refactor-tool.php help
Commands / Functionalities
autoloading

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
–restrict

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\-(.*)~'

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.