Skip to content

Fix stale console helper namespace in cakephp60 set#409

Open
dereuromark wants to merge 1 commit into
6.xfrom
feature/cakephp60-console-helper-namespace
Open

Fix stale console helper namespace in cakephp60 set#409
dereuromark wants to merge 1 commit into
6.xfrom
feature/cakephp60-console-helper-namespace

Conversation

@dereuromark

Copy link
Copy Markdown
Member

Follow-up to #408.

Console helpers moved from Cake\Command\Helper to Cake\Console\Helper in 5.4 (core keeps class_alias shims there), and the old namespace is removed entirely in 6.0. The cakephp60 set did not account for that:

  • There was no class rename, so an app coming from 5.3 or older kept referencing a namespace that no longer exists in 6.0.
  • The underscore property and method maps were keyed only on Cake\Command\Helper\{Progress,Table,Tree}Helper. For anyone who had already run cakephp54 (or moved by hand), those entries never matched, so _progress, _calculateWidths, _render and friends were silently left alone.

This adds the rename and registers the maps under Cake\Console\Helper\* as well. The old keys stay in place, since an app upgrading straight from 5.3 still resolves those classes to their pre 5.4 location and would otherwise miss the underscore renames.

Covered by a new ConsoleHelperExample fixture in the testApply60 app.

Note: the upgraded fixture keeps the now-unused use Cake\Command\Helper\TableHelper; and emits an FQCN in the property type. That is how RenameClassRector behaves throughout this repo (the cakephp53 fixture shows the same), and an unused import of a removed class is inert at runtime. Worth cleaning up globally at some point, but that would churn every set's fixtures, so it is out of scope here.

Console helpers moved from Cake\Command\Helper to Cake\Console\Helper in
5.4, and the old namespace is gone in 6.0.

- Add the class rename to the set, so apps coming from 5.3 or older get
  their references updated.
- Register the underscore property and method maps under the new
  namespace. They were only keyed on the old one, so they never matched
  for anyone who had already moved.

The old keys stay in place for apps upgrading straight from 5.3, where
the classes still resolve to the pre 5.4 location.
@dereuromark dereuromark added this to the 6.x milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant