Skip to content

A simple tool for refactoring legacy PHP code

License

Notifications You must be signed in to change notification settings

elvanto/referee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Referee

Referee is a simple tool for refactoring legacy PHP code, based on the strategies presented in Paul M. Jones' book Modernizing Legacy Applications in PHP.

Installation

The preferred installation method is composer;

composer require-dev elvanto/referee

Usage

A list of valid commands can be found by running vendor/bin/referee list. Before executing any of the commands, it is recommended that you are using a version control system with a clean working copy. This will ensure that any unwanted changes can be rolled back without affecting prior changes.

Using the --dry-run flag with any of the commands will result in changes being reported without any files being updated.

Extracting static classes from function files

The extract-class command takes the name of a file containing function definitions and generates a namespaced class with equivalent static methods. Any usages of the original functions in the <search> directories will be replaced with appropriate static method calls on the newly generated class. All files are changed in place.

Further commands will be added in future.

License

MIT License

About

A simple tool for refactoring legacy PHP code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages