Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Fan2Shrek
Copy link
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
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