Skip to content

Conversation

@Bogghi
Copy link

@Bogghi Bogghi commented Jul 22, 2025

This pull request updates the naming convention for migration class names in the Create command to use PascalCase instead of CamelCase. The changes ensure consistency in the format and provide clear guidance to users.

Updates to naming convention:


$this->setDescription('Create a new migration')
->addArgument('name', InputArgument::OPTIONAL, 'Class name of the migration (in CamelCase)')
->addArgument('name', InputArgument::OPTIONAL, 'Class name of the migration (in PascalCase)')
Copy link
Member

@dereuromark dereuromark Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not a typo, the naming convention so far dictates:

  • CamelCase
  • camelBacked

as official wordings
https://book.cakephp.org/5/en/intro/conventions.html

PascalCase is just an alias that is much more uncommon in our circles and not clear to many (camel from the animal is).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess strictly speaking it would be
UpperCamelCase
vs
lowerCamelCase

https://en.wikipedia.org/wiki/Camel_case

But we simplified that 20+ years ago and have that convention for 2 decades now using the above naming.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks a lot for the clarification and now i understand and share your convention. Wouldn't be useful to specify camedBacked to avoid confusion when reading the warning in the console?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the warning ist correct.
Or what do you want to change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My advice would be this: since the format of the name should be camelBacked as per convention it would be useful to specify it instead of saying camelCase. Today I've lost about 10 minutes trying to understand why it wasn't accepting the camelCase name of the class.

It's a minor change but it would make it clear what the format of the class should be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is supposed to be CamelCase and thats the message

@dereuromark
Copy link
Member

"CamelCaseControllerName" is correct format. Closing.

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