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

[make:entity] Cannot create an entity called "Locale" #1479

Open
madflow opened this issue Mar 15, 2024 · 2 comments
Open

[make:entity] Cannot create an entity called "Locale" #1479

madflow opened this issue Mar 15, 2024 · 2 comments
Labels

Comments

@madflow
Copy link

madflow commented Mar 15, 2024

I cannot create an entity called "Locale" on a freshly bootstrapped Symfony project.

symfony new app --version="7.0.*"
cd app
composer require symfony/maker-bundle
composer require symfony/orm-pack
./bin/console make:entity Locale
Your entity already exists! So let's add some new fields!
[critical] Error thrown while running command "make:entity Locale". Message: "Notice: file_get_contents(): Read of 8736 bytes failed with errno=21 Is a directory"

In FileManager.php line 111:

  Notice: file_get_contents(): Read of 8736 bytes failed with errno=21 Is a directory


make:entity [-a|--api-resource] [-b|--broadcast] [--regenerate] [--overwrite] [--] [<name>]

I would argue, that this should be possible.

I can think of a name collision with the global "Locale" class. https://www.php.net/manual/de/class.locale.php

@smnandre
Copy link
Contributor

It seems to be a side effect of #1422

@smnandre
Copy link
Contributor

I think #1422 should be reverted, as it contredict the documentation of the method :/

     * @param string $name            The short "name" that will be turned into the class name
     * @param string $namespacePrefix Recommended namespace where this class should live, but *without* the "App\\" part
     * @param string $suffix          Optional suffix to guarantee is on the end of the class

I started something using ReflectionClass::isInternal() , that could help in this specific case. But overall i'm not sure we should change the original behaviour. For the absolute path, it would require using \\ as before, but that was more self-explanatory than today :|

jrushlow added a commit to jrushlow/maker-bundle that referenced this issue Mar 16, 2024
@jrushlow jrushlow added Bug Bug Fix HasPR labels Mar 16, 2024
@jrushlow jrushlow changed the title Cannot create an entity called "Locale" [make:entity] Cannot create an entity called "Locale" Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants