elvanto/referee

A simple tool for refactoring legacy PHP code

0.0.1 2016-05-31 05:01 UTC

This package is auto-updated.

Last update: 2024-10-25 18:51:51 UTC


README

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