Skip to content

Commit 11125c7

Browse files
authored
Merge pull request #8149 from cakephp/add-rector-migration-docs
Add upgrade tool documentation to migration guides
2 parents 1d06379 + f676c39 commit 11125c7

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

en/appendices/5-1-migration-guide.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ The 5.1.0 release is a backwards compatible with 5.0. It adds new functionality
55
and introduces new deprecations. Any functionality deprecated in 5.x will be
66
removed in 6.0.0.
77

8+
Upgrade Tool
9+
============
10+
11+
The :doc:`upgrade tool </appendices/migration-guides>` provides rector rules for
12+
automating some of the migration work. Run rector before updating your
13+
``composer.json`` dependencies::
14+
15+
bin/cake upgrade rector --rules cakephp51 <path/to/app/src>
16+
817
Behavior Changes
918
================
1019

en/appendices/5-2-migration-guide.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ The 5.2.0 release is a backwards compatible with 5.0. It adds new functionality
55
and introduces new deprecations. Any functionality deprecated in 5.x will be
66
removed in 6.0.0.
77

8+
Upgrade Tool
9+
============
10+
11+
The :doc:`upgrade tool </appendices/migration-guides>` provides rector rules for
12+
automating some of the migration work. Run rector before updating your
13+
``composer.json`` dependencies::
14+
15+
bin/cake upgrade rector --rules cakephp52 <path/to/app/src>
16+
817
Behavior Changes
918
================
1019

en/appendices/5-3-migration-guide.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ The 5.3.0 release is a backwards compatible with 5.0. It adds new functionality
55
and introduces new deprecations. Any functionality deprecated in 5.x will be
66
removed in 6.0.0.
77

8+
Upgrade Tool
9+
============
10+
11+
The :doc:`upgrade tool </appendices/migration-guides>` provides rector rules for
12+
automating some of the migration work. Run rector before updating your
13+
``composer.json`` dependencies::
14+
15+
bin/cake upgrade rector --rules cakephp53 <path/to/app/src>
16+
817
Upgrade to PHP 8.2
918
==================
1019

en/appendices/migration-guides.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ Migration Guides
44
Migration guides contain information regarding the new features introduced in
55
each version and the migration path between 5.x minor releases.
66

7+
Upgrade Tool
8+
============
9+
10+
CakePHP provides an `upgrade tool <https://github.com/cakephp/upgrade>`__ that
11+
automates many code changes using `Rector <https://getrector.com/>`__. The tool
12+
has rulesets for each minor version to help automate tedious code changes like
13+
method renames and signature updates.
14+
15+
To use the upgrade tool::
16+
17+
# Install the upgrade tool
18+
git clone https://github.com/cakephp/upgrade
19+
cd upgrade
20+
git checkout 5.x
21+
composer install --no-dev
22+
23+
# Run rector with the desired ruleset
24+
bin/cake upgrade rector --rules cakephp51 <path/to/app/src>
25+
26+
Run rector before updating your ``composer.json`` dependencies
27+
to ensure the tool can resolve class names correctly.
28+
729
.. toctree::
830
:maxdepth: 1
931

0 commit comments

Comments
 (0)