symfony / symfony/maker-bundle

make:entity ignores psr-4 path from composer.json

Open
#272 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When you have set a psr-4 path for the autoloader in composer.json the make:entity ignores this and always tries to create the file at src/Entity.

Eg. if you have this in your composer.json so that the classes in Example\... namespace are stored in src/Example/... the make:entity always generates the entity file at src/Entity instead of src/Example/Entity.

  "autoload": {
    "psr-4": {
      "Example\\": "src/Example"
    }
  },

For make:controller this seem to work correct as it does not rely on hardcoded paths like in MakeEntity.php

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 in MakeEntity.php and reproduce the issue with the composer.json PSR-4 mapping shown in the report. Compare its path handling with make:controller, then verify that make:entity places the generated file under src/Example/Entity rather than src/Entity.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.