Skip to content

Conversation

@dereuromark
Copy link
Member

@dereuromark dereuromark commented Nov 26, 2025

Refs cakephp/cakephp#19086

Unfortunately, CakePHP's CommandCollection doesn't have a built-in mechanism to hide specific command aliases from the list - the hidden property on Command
classes applies to the command itself regardless of which name it's invoked with. Both will appear in bin/cake output, but both will work identically.

So we need a feature flag switch

Summary

  • Add TwigView.useUnderscoreCommands config option for command naming style
  • When true: registers twig_view compile (new underscore style)
  • When false/unset: registers twig-view compile (deprecated hyphen style)
  • Add config/app.example.php documenting available options
  • Add PHPUnit 12 support

Upgrade path

  1. Update scripts/CI to use twig_view compile
  2. Set 'TwigView.useUnderscoreCommands' => true in config

We should be able to release this as a minor

dereuromark and others added 2 commits November 26, 2025 20:39
- Add TwigView.useUnderscoreCommands config option
- When true: registers `twig_view compile` (new style)
- When false/unset: registers `twig-view compile` (deprecated)
- Add config/app.example.php documenting available options
- Add PHPUnit 12 support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@dereuromark dereuromark requested a review from ADmad November 26, 2025 19:49
@dereuromark dereuromark marked this pull request as ready for review November 26, 2025 19:50
@dereuromark dereuromark added the enhancement New feature or request label Nov 26, 2025
@ADmad
Copy link
Member

ADmad commented Nov 28, 2025

I doubt anyone is going to notice or use this config.

Another solution is adding both twig-view compile and twig_view compile and show deprecation warning when the old name is used. I checked and it works, only problem is the bin/cake only shows the dashed name twig-view compile in the help output regardless of the order in which the commands are added.

@dereuromark
Copy link
Member Author

Yeah thats why the config: It allows the upgrade for those that want it, everyone else can safely ignore. No duplicate or weird display either way.

@ADmad
Copy link
Member

ADmad commented Nov 28, 2025

But this config doesn't provide us a deprecation based upgrade path as we do for classes/methods, continue use of existing API with a deprecation while adding a new one.

@dereuromark
Copy link
Member Author

As this is purely opt-in. If you think it is important you can also add a deprecation note of course to alert the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants