五款PHP代码重构工具推荐_PHP
在软件工程学里,重构代码一词通常是指在不改变代码的外部行为情况下而修改源代码。软件重构需要借助工具完成,而重构工具能够修改代码同时修改所有引用该代码的地方。本文收集了五款出色的PHP代码重构工具,以帮助你完善更加优秀的项目。
1. Rephactor
Rephactor是一款命令行重构工具,这是一款自动化工具,允许开发者以一种简洁的方式在不同的代码库中修改源码。
主要功能:
保证重构的可逆性—— 一旦发现问题,代码是可逆的,可以回溯到前一个版本。
查找替换功能—— 普通查找替换,方法重命名,类重命名,正则表达式模式的替换。
所有操作完成后,均基于SimpleTest Aperiplus进行测试,并保证测试的覆盖率。
集成Phemto ,保证类的相关性测试。
2. Scisr
Scisr是一款利用PHP编写的重构工具。项目托管在GitHub上。基于GPL许可证下发行。
使用方法:
类的重命名:
代码如下:
$ scisr rename-class OldName NewName [files]
修改方法:
代码如下:
$ scisr rename-method OwningClassName oldMethodName newMethodName [files]
文件重命名:
代码如下:
$ scisr rename-file old/file_name new/dir/new_file_name [files]
重命名类和文件:
代码如下:
$ scisr rename-class-file OldClassName NewClassName [files]
3. PHP Refactoring Browser
这是一款PHP 代码的重构工具,通过生成diffs来描述重构的步骤,避免重构过程中的简单错误,该工具非常棒。项目托管在GitHub上。
使用库:
PHP Parser by Nikic
PHP Token Reflection from Ondřej Nešp
重构浏览器数据主要包含以下几个方面:
补丁——支持基于更改文件操作创建补丁;
重构——包含实际重构域和适配第三方库;
集合——基于PHP数组可靠添加集合语义。目前包含一组类型。
4. PhpStorm
PhpStorm是由JetBrains公司开发的一款PHP IDE富应用,同时支持重构。PhpStorm可随时帮助用户对其编码进行调整,运行单元测试或者提供可视化调试功能。
目前,发布了PhpStorm 7版本,新版本支持PHP5.5;改进PHP语法着色性能;Vagrant、SSH 控制&远程工具;支持Drupal & PHP框架;改进调试和测试性能。
PhpStorm的主要特性:
智能PHP编码编辑器;
代码质量分析;
支持调试/测试;
支持HTML/CSS/JavaScript编辑器;
支持跨平台。
5. Zend Studio
Zend Studio是Zend Technologies开发的PHP语言集成开发环境。支持HTML和JS标签,但只对PHP语言提供调试支持。
主要特性:
具备功能强大的专业编辑工具和调试工具;
支持PHP语法高亮显示、语法自动填充功能,支持语法自动缩排和代码复制功能;
支持书签功能;
内置一个强大的PHP代码调试工具;
支持本地和远程两种调试模式,支持多种高级调试功能。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
