Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Insight] The composer.json file should not raise warnings - in composer.json, line 0 #32

Open
nils-van-zuijlen opened this issue Nov 17, 2016 · 1 comment
Assignees

Comments

@nils-van-zuijlen
Copy link
Owner

in composer.json

Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance


Posted from SensioLabsInsight

@Strategy47
Copy link

Strategy47 commented Mar 16, 2017

Hi,

All your /src/bundles should be in the Caravane folder
And all bundles should use the namespace Caravane

For example:
https://github.com/nils-van-zuijlen/caravane/blob/master/src/UserBundle/UserBundle.php#L3

namespace UserBundle;
namespace Caravane\UserBundle;

After that you would have more than to update your psr4

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

Would change

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

Currently you can still do

    "autoload": {
        "psr-4": {
           "CoreBundle\\": "src/CoreBundle",
           "ForumBundle\\": "src/ForumBundle",
           "ResponsabilitesBundle\\": "src/ResponsabilitesBundle",
           "UserBundle\\": "src/UserBundle"
        },

Be aware that this practice is not a best practice 😄

@nils-van-zuijlen nils-van-zuijlen self-assigned this Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants