Skip to content

remove defaultName method from baked command#1081

Merged
LordSimal merged 1 commit into3.xfrom
3.x-cleanup-command
May 3, 2026
Merged

remove defaultName method from baked command#1081
LordSimal merged 1 commit into3.xfrom
3.x-cleanup-command

Conversation

@LordSimal
Copy link
Copy Markdown
Contributor

It was added in #1030 but its not really needed, as it gets statically inflected by the classname anyways.

This makes the user generated code clearer as there is only 1 place where the command name is defined, not 2.

@LordSimal LordSimal added this to the 3.x (CakePHP 5) milestone May 2, 2026
@LordSimal
Copy link
Copy Markdown
Contributor Author

According to @ADmad the difference between those 2 is as follows:

the static method provides the default name used for command list without having to instantiate the command. The prop holds the name used when explicitly adding commands using CommandCollection::add() from App's console() hook

@LordSimal LordSimal merged commit 093b385 into 3.x May 3, 2026
9 checks passed
@LordSimal LordSimal deleted the 3.x-cleanup-command branch May 3, 2026 11:08
@ADmad
Copy link
Copy Markdown
Member

ADmad commented May 7, 2026

This need to be reverted as setting the default name is required for plugins. As seen in the updated example the default name should be 'test_bake example' (baked using bin/cake command TestBake.Example) but after this change the default implementation of BaseCommand::defaultName() with return example.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants