From f676c392ed529ccbec218ecd28a47bb472e229b1 Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 1 Jan 2026 17:56:44 +0100 Subject: [PATCH] Add upgrade tool documentation to migration guides Add references to the rector-based upgrade tool in the migration guides index page and in each minor version migration guide (5.1, 5.2, 5.3). This improves discoverability of the upgrade tool which has rulesets for each minor version to help automate code changes. Fixes #8056 --- en/appendices/5-1-migration-guide.rst | 9 +++++++++ en/appendices/5-2-migration-guide.rst | 9 +++++++++ en/appendices/5-3-migration-guide.rst | 9 +++++++++ en/appendices/migration-guides.rst | 22 ++++++++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/en/appendices/5-1-migration-guide.rst b/en/appendices/5-1-migration-guide.rst index caac02853f..3943d7982a 100644 --- a/en/appendices/5-1-migration-guide.rst +++ b/en/appendices/5-1-migration-guide.rst @@ -5,6 +5,15 @@ The 5.1.0 release is a backwards compatible with 5.0. It adds new functionality and introduces new deprecations. Any functionality deprecated in 5.x will be removed in 6.0.0. +Upgrade Tool +============ + +The :doc:`upgrade tool ` provides rector rules for +automating some of the migration work. Run rector before updating your +``composer.json`` dependencies:: + + bin/cake upgrade rector --rules cakephp51 + Behavior Changes ================ diff --git a/en/appendices/5-2-migration-guide.rst b/en/appendices/5-2-migration-guide.rst index 66567f439a..821ddbf184 100644 --- a/en/appendices/5-2-migration-guide.rst +++ b/en/appendices/5-2-migration-guide.rst @@ -5,6 +5,15 @@ The 5.2.0 release is a backwards compatible with 5.0. It adds new functionality and introduces new deprecations. Any functionality deprecated in 5.x will be removed in 6.0.0. +Upgrade Tool +============ + +The :doc:`upgrade tool ` provides rector rules for +automating some of the migration work. Run rector before updating your +``composer.json`` dependencies:: + + bin/cake upgrade rector --rules cakephp52 + Behavior Changes ================ diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 80759818ac..f410d72900 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -5,6 +5,15 @@ The 5.3.0 release is a backwards compatible with 5.0. It adds new functionality and introduces new deprecations. Any functionality deprecated in 5.x will be removed in 6.0.0. +Upgrade Tool +============ + +The :doc:`upgrade tool ` provides rector rules for +automating some of the migration work. Run rector before updating your +``composer.json`` dependencies:: + + bin/cake upgrade rector --rules cakephp53 + Upgrade to PHP 8.2 ================== diff --git a/en/appendices/migration-guides.rst b/en/appendices/migration-guides.rst index 51004d9d42..44e76fd61c 100644 --- a/en/appendices/migration-guides.rst +++ b/en/appendices/migration-guides.rst @@ -4,6 +4,28 @@ Migration Guides Migration guides contain information regarding the new features introduced in each version and the migration path between 5.x minor releases. +Upgrade Tool +============ + +CakePHP provides an `upgrade tool `__ that +automates many code changes using `Rector `__. The tool +has rulesets for each minor version to help automate tedious code changes like +method renames and signature updates. + +To use the upgrade tool:: + + # Install the upgrade tool + git clone https://github.com/cakephp/upgrade + cd upgrade + git checkout 5.x + composer install --no-dev + + # Run rector with the desired ruleset + bin/cake upgrade rector --rules cakephp51 + +Run rector before updating your ``composer.json`` dependencies +to ensure the tool can resolve class names correctly. + .. toctree:: :maxdepth: 1