symfony/maker-bundle

make:entity fails with entity name "Repository"

Open

#964 opened on 2021年9月1日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)PHP (425 forks)auto 404
BugGood First IssueHasPR

Repository metrics

Stars
 (3,384 stars)
PR merge metrics
 (PR metrics pending)

説明

I know that Repository isn't THE BEST name for an entity, but I found that make:entity have problem with generation of such.

Maker creates Repository called Repository instead of RepositoryRepository and because of that, their use sections conflicts (same name of Entity and Repository)

Steps to reproduce:

symfony new test;
cd test;
composer req orm;
composer req maker;
php bin/console make:entity Repository

Result:

PHP Fatal error:  Cannot declare class App\Entity\Repository because the name is already in use in /home/jerzy/test/src/Entity/Repository.php on line 11

I see two possible solutions:

  1. Fix the bug
  2. Block "Repository" as reserved keyword

コントリビューターガイド