-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Bundle Naming #3616
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
Comments
Yes, you can do it wherever you like. :) We may need to update that article though, by adding the PSR-4 standard information. Thanks for notifying us! (you if have some time, youcan also hit the "edit" button yourself and update the article using PSR-4, that'll be very great!) |
Is the PSR-4 standard really worth to be mentionend here? I mean it doesn't affect any of the guidelines we describe, does it? |
@xabbuh PSR-0 allows namespaces like |
@wouterj I'd like to, but my English is very bad for it. |
@xabbuh it doesn't affect the text, however it does change the table with examples. @ossinkine don't worry about your english. 90% of de doc contributors are bad english speaking non-natives (including myself). We'll help you and after all, we have a very friendly merger (@weaverryan) which will fix all bad english in a PR after the merge 😆 But well, now I think about it. Nothing in the article talks about the location of the bundle, only about the namespace and name of a bundle. So it isn't affected by PSR-4. Where did you think we were talking about locations? (if we know that, we can add a tip box saying something like "If your bundle uses PSR-4, the namespace may differ from the actual location of the bundle (e.g. |
@wouterj Yes, I mean that file |
@ossinkine Your fully qualified namespace would even with PSR-4 be something like |
| Q | A | ------------- | --- | Doc fix? | no | New feature? | no | Applies to | 2.0+ | Tests pass? | yes | Fixed tickets | symfony#3616
I do think we should mention that you're allowed to follow PSR-0 or PSR-4. I also think that the example table should be updated to give better examples. Specifically, You should have a vendor namespace then your bundle name. I think examples like Even the Thanks! |
And btw, this entry is about re-usable bundles, not application-specific bundles, so we can really target our information at that audience - see #4250. Thanks! |
| Q | A | ------------- | --- | Doc fix? | no | New feature? | no | Applies to | 2.0+ | Tests pass? | yes | Fixed tickets | #3616
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #4255). Discussion ---------- Updated autoload standard to PSR-4. | Q | A | ------------- | --- | Doc fix? | no | New feature? | no | Applies to | 2.0+ | Tests pass? | yes | Fixed tickets | #3616 Commits ------- d9a2f61 Updated autoload standard to PSR-4.
… (javiereguiluz) This PR was merged into the 2.3 branch. Discussion ---------- Updated the best practices article for reusable bundles | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | #3616 Commits ------- 286631d Added a blank line beteen definition list items 776eaee Reworded as a definition list 4276ced Added back some information wrongly removed during the rebase fa0b902 Fixed a minor syntax issue 9981193 Minor fixes and added a cross link a391563 Updated the best practices article for reusable bundles
| Q | A | ------------- | --- | Doc fix? | no | New feature? | no | Applies to | 2.0+ | Tests pass? | yes | Fixed tickets | symfony#3616
On https://github.com/symfony/symfony-docs/blob/master/cookbook/bundles/best_practices.rst says that namespace must follow the technical interoperability standard PSR-0. Must namespace follow the standard PSR-4? In particular, is it allowed to use the namespace for bundle MyBlogBundle? E.g. can I place my bundle class in src/MyBlogBundle/MyBlogBundle.php?
The text was updated successfully, but these errors were encountered: