Fix stale console helper namespace in cakephp60 set#409
Open
dereuromark wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #408.
Console helpers moved from
Cake\Command\HelpertoCake\Console\Helperin 5.4 (core keepsclass_aliasshims there), and the old namespace is removed entirely in 6.0. Thecakephp60set did not account for that:Cake\Command\Helper\{Progress,Table,Tree}Helper. For anyone who had already runcakephp54(or moved by hand), those entries never matched, so_progress,_calculateWidths,_renderand 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
ConsoleHelperExamplefixture in thetestApply60app.Note: the upgraded fixture keeps the now-unused
use Cake\Command\Helper\TableHelper;and emits an FQCN in the property type. That is howRenameClassRectorbehaves throughout this repo (thecakephp53fixture 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.