We've released the Rector - The Power of Automated Refactoring book with goal of continuous upgrades. It's been a year since last upgrade, so it's time to step up and deliver fresh 2024 book release.
Key Highlights of this update are:
New Chapter: Explore "Node Type and Refactor Examples"
Featuring typical refactor() use-cases, enhancing your refactoring skills.
Simplified Configuration
Introducing a minimalist RectorConfig::configure() config for smoother setup.
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([__DIR__ . '/app', __DIR__ . '/tests'])
->withImportNames(removeUnusedImports: true)
->withPreparedSets(codeQuality: true, codingStyle: true, instanceOf: true)
->withPhpSets();
Convenient Commands
New commands, such as setup-ci and custom-rule, to streamline your workflow.
Code Examples in Git Repository
Access a complete code repository at rectorphp/rector-book-code-examples for comprehensive learning.
Improved Visuals
- Enhancements in rule and test file visualization for better understanding.
- Dependency Updates: Keeping pace with technology, we've updated dependencies, including Rector (0.15 → 1.0), PHP (8.0 → 8.2), ECS (to 12.1), and PHPUnit (9.5 → 10.5).
- Clarification: Added a section on differentiating between
StmtandExprin the "Creating Your First Rector Rule" chapter. - Refactoring Insights: Discover use of attributes for more efficient refactoring.
This update empowers you to become a code refactoring expert with the latest 2024 Rector features.
It's available immediately for all existing readers.
If you haven't purchased the book yet, grab your copy now!
Happy coding!