Static Analysis and Automated Refactoring

With PHPStan you can catch many programming mistakes before they reach your production server. Rector can fix many programming mistakes for you.

Since Rector relies heavily on PHPStan, the first step towards automated refactoring is static analysis. This training focuses on setting up PHPStan for your project, making it part of your development workflow, and extending it with your own rules. At the end of the program we kickstart automated refactoring with Rector.

Outline:

  • Static Analysis with PHPStan
    • Setup and configuration
    • Workflow
    • Fixing errors
    • Documenting types
    • Generic types
    • Ignoring errors
    • The Baseline
    • Creating custom rules and type resolvers (TDD style)
  • Automated Refactoring with Rector
    • Setting up Rector
    • Configuring rules
    • Custom rules

A training day starts at 09:30 and ends at 17:00. We work with a sandbox environment where we can run PHPStan and Rector. We make the assignments together. The participants navigate the trainer towards the solutions (a method known as ensemble or mob programming).

Would you like me to provide this training to you and your team? Check out the options for on-site and remote Training & Consultancy.