symfony / symfony/maker-bundle

make:crud tries to use the wrong class when the specified class name is the first part of another class name

Open
#141 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
PHP
Stars
3.4k
Forks
427
Avg merge
2d 22h
Merged PRs (30d)
20

Description

For example, I used make:crud to generate a controller for my entity SampleClassification. Then I created another entity Sample, but when I tried to make:crud for Sample I got this error:

[ERROR] The file "src/Controller/SampleClassificationController.php" can't be generated because it already exists.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the make:crud command and reproduce the reported sequence using SampleClassification followed by Sample. Inspect how the requested class name is matched to the generated controller path. Done means requesting Sample generates SampleController.php instead of reusing SampleClassificationController.php.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.