Skip to content

fix: EnumCaseToPascalCaseRector skips existing pascal case#7264

Merged
samsonasik merged 2 commits intorectorphp:mainfrom
calebdw:calebdw/push-qsyqklmzmtxo
Sep 14, 2025
Merged

fix: EnumCaseToPascalCaseRector skips existing pascal case#7264
samsonasik merged 2 commits intorectorphp:mainfrom
calebdw:calebdw/push-qsyqklmzmtxo

Conversation

@calebdw
Copy link
Contributor

@calebdw calebdw commented Sep 14, 2025

Closes rectorphp/rector#9374

Thanks!


private function convertToPascalCase(string $name): string
{
if ($this->isPascalCase($name)) {
Copy link
Member

Choose a reason for hiding this comment

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

use existing convertToPascalCase() method, compare, if same, then skip

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not going to work here, the convertToPascalCase() method is not idempotent

Copy link
Member

Choose a reason for hiding this comment

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

that strange that the check already there

if ($currentName === $pascalCaseName) {
continue;
}

I am on mobile, I will check when I am back to PC

Copy link
Member

@samsonasik samsonasik Sep 14, 2025

Choose a reason for hiding this comment

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

I've updated to use existing convertToPascalCase method 2a86213

@samsonasik samsonasik force-pushed the calebdw/push-qsyqklmzmtxo branch from a0d2cc9 to 2a86213 Compare September 14, 2025 07:53
@samsonasik
Copy link
Member

@calebdw this should be ok now :)

@samsonasik samsonasik merged commit 69764a7 into rectorphp:main Sep 14, 2025
49 checks passed
@samsonasik
Copy link
Member

Thank you @calebdw

@calebdw calebdw deleted the calebdw/push-qsyqklmzmtxo branch September 14, 2025 12:05
@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect behavior of EnumCaseToPascalCaseRector

2 participants