New Video Series: Refactoring With PhpStorm by Matthew Setter
We’ve collaborated with PHP engineer and technical trainer Matthew Setter to bring you a 7-part video series showing how to systematically improve the quality of your code using PhpStorm’s refactoring functionality.
Check out the first two episodes!
What you are going to learn
In this series Matthew’s going to teach you how to perform the following refactorings:
- Change Signature: You’ll learn how to change method names and return types; add, remove, and reorder parameters, and assign default values to parameters; change parameter names and types; and propagate new parameters through the method call hierarchy.
- Extract Class: You’ll discover how to make classes more cohesive and, if they get too large, how to extract methods and fields into a new class.
- Extract Constant: We’ll explore how to make your source code easier to read and maintain by refactoring hard-coded constants that provide no explanation of their value or purpose into class constants.
- Extract Interface: You’ll learn how to extract methods to an interface and mark the source class as implementing the new interface.
- Extract Method: We’ll discuss how to refactor code into a new method so that it can be used over and over again.
- Inline Variable: You’ll learn how to replace the usage of a redundant variable with the variable’s underlying expression.
- Introduce Field: You’ll discover how to refactor an expression into a new class-level field so that it can be readily used throughout the class.
- Introduce Variable: You’ll learn how to refactor a selected expression into a new variable, which greatly helps reduce code duplication.
- Rename: You’ll learn how to rename symbols, such as variables, constants, classes, and methods, as well as files and directories, so that they are more intuitive, meaningful, and representative of their purpose.
- Pull Members Up: You’ll learn how to move class members up to parent classes. This helps you avoid manually copying methods and fields from one class into another, along with updating references to them.
By the end of this series, you’ll be proficient at using PhpStorm to clean up code.
About Matthew Setter
Matthew Setter is an Australian web developer with over 15 years of professional software development experience. He has been working with PHP ever since version 3. He specializes in PHP’s Mezzio framework and wrote the foundational book: Mezzio Essentials.
Twitter | Blog