The PHP framework can be a single entry, fully object-oriented, completely based on the MVC pattern of classes. However, we face a large number of old code, or even the new code, is not entirely consistent with object-oriented principles, consistent with design patterns. Small application is no harm. But if the face of large-scale applications, it must be a big pain!!
What to do? A lot of people always face this, PHP code needs refactoring. (Of course, if you can understand what I'm talking about, you must have seen refactoring--improving the design of existing code.)
Look at this link:http://zh-cn.w3support.net/index.php?db=so&id=100876 We can understand the pain of reconstruction! This is inevitable. But how can this pain be made lighter?
Refactoring tools are necessary. Fortunately, now there is really a PHP refactoring tool--rephactor. It's really a very good tool. (Of course, you have to remember that there has never been a fully automated refactoring tool that can never replace a human brain, that all the refactoring goals, and every step of the way, is still going to be done in terms of refactoring-improving the design of existing code. )
So: What did Rephactor offer us?
- Ensure the reversibility of refactoring-once the problem is discovered, the code is reversible and can be traced back to the previous version.
- Find replacements--normal lookup substitution, method renaming, class renaming, and replacement of regular expression patterns.
- After all operations are completed, the tests are based on simpletest Aperiplus and the coverage of the tests is ensured.
- Integrate Phemto to ensure class correlation testing.
Of course, it has some limitations that can only run on the Linux operating system, and only support PHP5.2
Are you interested? With it, your refactoring will be much faster, and there will be no new bugs.
Official website:http://rephactor.sourceforge.net/
Why not install one and try?