[autocorrect] make:entity selects incorrect class when input class contains part of another

Open
#794 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reproducing the issue with an existing App\Entity\AppConfigSetting and a requested App\Entity\AppConfig through make:entity. Trace the make:entity command's class selection and add a regression test for the name collision. Done means the requested AppConfig class is selected rather than the existing AppConfigSetting class.

Written by the indexing model from the issue text.

Description

Bug duplicate

I have an existing App\Entity\AppConfigSetting class, and now want to make App\Entity\AppConfig. Attempting make:entity with the non-existing "AppConfig" class gives me the following behavior:

Screenshot 2021-01-24 103923

I've had this happen several times over the past year - always when I'm trying to create a new class that contains part of an existing class name.

symfony/maker-bundle version 1.28

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

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.

More from symfony/maker-bundle

All issues in symfony/maker-bundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.