The orm:generate-repositories command still uses psr-0 #5778

Closed
opened 2026-01-22 15:17:31 +01:00 by admin · 2 comments
Owner

Originally created by @jorygeerts on GitHub (Nov 21, 2017).

Originally assigned to: @Ocramius on GitHub.

If you run orm:generate-repositories src/, repositories are generated in src/Vendor/Package/, psr-0 style.
Given the fact that psr-0 has been deprecated for over two years, I feel it would be a good step add support for psr-4.

The most straight forward way to do this would be an extra option to orm:generate-repositories called psr4-prefix or something in that spirit. EntityRepositoryGenerator::writeEntityRepositoryClass() could then be changed to remove that prefix from the start of $fullClassName before generating the $path.

If this is a change people would like to see, I'm more then willing to write the code and open a pull request.

Originally created by @jorygeerts on GitHub (Nov 21, 2017). Originally assigned to: @Ocramius on GitHub. If you run `orm:generate-repositories src/`, repositories are generated in `src/Vendor/Package/`, psr-0 style. Given the fact that psr-0 has been deprecated for over two years, I feel it would be a good step add support for psr-4. The most straight forward way to do this would be an extra option to `orm:generate-repositories` called `psr4-prefix` or something in that spirit. `EntityRepositoryGenerator::writeEntityRepositoryClass()` could then be changed to remove that prefix from the start of `$fullClassName` before generating the `$path`. If this is a change people would like to see, I'm more then willing to write the code and open a pull request.
admin added the New FeatureWon't FixQuestion labels 2026-01-22 15:17:31 +01:00
admin closed this issue 2026-01-22 15:17:31 +01:00
Author
Owner

@Ocramius commented on GitHub (Nov 21, 2017):

Not gonna happen: Doctrine voted against the abbreviated PSR-4 directory prefixing approach ages ago, and still stands against it.

It is needless complexity that isn't needed.

In addition to that, code generators are likely targeted for removal in 3.x.

@Ocramius commented on GitHub (Nov 21, 2017): Not gonna happen: Doctrine voted against the abbreviated PSR-4 directory prefixing approach ages ago, and still stands against it. It is needless complexity that isn't needed. In addition to that, code generators are likely targeted for removal in 3.x.
Author
Owner

@jorygeerts commented on GitHub (Nov 21, 2017):

Doctrine voted against the abbreviated PSR-4 directory prefixing approach ages ago, and still stands against it.

I wasn't aware of that and a search of the issues didn't bring up anything; sorry for bringing it up again. :)
Thanks for the quick response.

@jorygeerts commented on GitHub (Nov 21, 2017): > Doctrine voted against the abbreviated PSR-4 directory prefixing approach ages ago, and still stands against it. I wasn't aware of that and a search of the issues didn't bring up anything; sorry for bringing it up again. :) Thanks for the quick response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5778