Skip to content

Allow creation of classes with the same name as PHP native classes#1676

Open
Fan2Shrek wants to merge 1 commit intosymfony:1.xfrom
Fan2Shrek:fix/creation-with-native-php-classname
Open

Allow creation of classes with the same name as PHP native classes#1676
Fan2Shrek wants to merge 1 commit intosymfony:1.xfrom
Fan2Shrek:fix/creation-with-native-php-classname

Conversation

@Fan2Shrek
Copy link
Copy Markdown
Contributor

Fix #1675

When trying to create a class with a native PHP name (e.g., Directory), Validator::classDoesNotExist incorrectly throws an error stating that the class already exists. To fix this, we need to prepend the namespace before performing the check.

@Fan2Shrek Fan2Shrek force-pushed the fix/creation-with-native-php-classname branch from 7bd0bd1 to a571ae6 Compare March 24, 2025 22:27
@Fan2Shrek Fan2Shrek force-pushed the fix/creation-with-native-php-classname branch from a571ae6 to bc92fb0 Compare March 24, 2025 22:37
@Fan2Shrek
Copy link
Copy Markdown
Contributor Author

The test failures are related, but I'm not entirely sure how Generator::createClassNameDetails is supposed to behave. In my view, it should assert that the FQCN does not exist, not just the class itself. However, related tests are failing.

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.

Cannot create an entity named 'Directory'

1 participant