In software engineering, the term refactoring code usually refers to changing the code without changing it. Modify the source code in case of external behavior. Software refactoring needs to be completed with the help of tools, and refactoring tools can modify the code and modify all places that reference the code. This article collects five excellent PHP code refactoring tools to help you improve better projects.
1. Rephactor
Rephactor is a command line refactoring tool. It is an automated tool that allows developers to modify source code in different code bases in a concise way.
Main functions:
2. Scisr
Scisr is a refactoring tool written in PHP. The project is hosted on GitHub. Released under GPL license.
How to use:
Class renaming:
$ scisr rename-class OldName NewName [files]
Modification method:
$ scisr rename-method OwningClassName oldMethodName newMethodName [files]
File rename:
$ scisr rename-file old/file_name new/dir/new_file_name [files]
Rename classes and files:
$ scisr rename-class-file OldClassName NewClassName [files]
3. PHP Refactoring Browser
This is a PHP code refactoring tool. It generates diffs to describe the steps of refactoring to avoid simple errors during the refactoring process. This tool is great. The project is hosted on GitHub.
Use library:
Reconstructing browser data mainly includes the following aspects:
4. PhpStorm
PhpStorm is a PHP IDE rich application developed by JetBrains and supports refactoring. PhpStorm can help users adjust their coding, run unit tests or provide visual debugging capabilities at any time.
Currently, PhpStorm 7 version has been released. The new version supports PHP5.5; improves PHP syntax coloring performance; Vagrant, SSH control & remote tools; supports Drupal & PHP framework; improves debugging and testing performance.
Main features of PhpStorm:
5. Zend Studio
Zend Studio is a PHP language integrated development environment developed by Zend Technologies. Supports HTML and JS tags, but only provides debugging support for PHP language.
Main features:
It is recommended to use phpstorm. The new ide that has been replaced in the past year has very powerful prompts for reconstructing svn. Well, zend studio 5 is not bad, and the automatic prompt response speed is also very fast. When using zend studio for Eclipse, the efficiency is not very satisfactory~
php5 will first look for function __construct() as the constructor. If it cannot find it, it will continue to search for the function with the same name as the constructor of the class