Summary

In this chapter, we've discussed some methods of refactoring code to ensure the design is always of a good quality. By refactoring code, we can gain a greater understanding of our code base and future-proof it for the additional functionality that we add to the software.

Simplification and breaking down the problems you face are two of the best fundamental tools you can use when refactoring code.

If you are using a CI environment, having PHP Mess Detector (PHPMD) running on that environment can also help you code better.

In the next chapter, I will discuss how we can use design patterns appropriately, starting off with a quick lesson on developing APIs in the context of a network.

Get Mastering PHP Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.