symfony / symfony/maker-bundle

[RFC] Add target option to all commands (dir relative to the project root)

Open
#51 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Related with https://github.com/symfony/maker-bundle/issues/2 and https://github.com/symfony/maker-bundle/issues/49

What about a new target option for each command that allows us to change the target directory where the final skeleton file is generated?

For example make:unit-test FooTest always creates the file class inside tests/ directory, but as the best practice recommends:

By convention, the tests/ directory should replicate the directory of your bundle for unit tests. So, if you're testing a class in the src/Util/ directory, put the test in the tests/Util/ directory.

Something like this make:functional-test FooTest --target=tests/Util will be great to not move each generated file to the corresponding directory and change its namespace.

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 by reviewing the make:unit-test and make:functional-test command entry points, then compare how the other commands choose their generated-file directories. Check the related issues #2 and #49 for context. Done means every command consistently accepts a target directory relative to the project root and generates the file there with the matching namespace.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.