Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Phinx/Console/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function configure(): void
parent::configure();

$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

->setHelp(sprintf(
'%sCreates a new database migration%s',
PHP_EOL,
Expand Down Expand Up @@ -194,7 +194,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} else {
if (!Util::isValidPhinxClassName($className)) {
throw new InvalidArgumentException(sprintf(
'The migration class name "%s" is invalid. Please use CamelCase format.',
'The migration class name "%s" is invalid. Please use PascalCase format.',
$className,
));
}
Expand Down
Loading