-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update best_practices.rst #9041
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We always use "CamelCase", "snake_case", etc. in the docs. Do you find this hard to understand? (I'm trying to better understand the reason for this change). Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz In PHP context
camelCase
usually uses to describe rule, when first letter is lower-case. If first letter is capitalized, this style usually callsStudlyCaps
.Reference: http://www.php-fig.org/psr/psr-1/
StudlyCaps
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As PSR is an official doc for PHP code style, better use PSR terminology for PHP projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeyPodgornyy thanks for the info. You are right and using the same terminology than PSR is the right thing to do. I added a minor clarification because StudlyCaps is less known than camelCase. Cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz Ok, but why you closed this PR without merging? 😒
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry for not explaining. You sent your pull request to 4.0 branch, but I merged it on 2.7 (this is the commit --> ac99784). You can see your work merged here: https://github.com/symfony/symfony-docs/commits/2.7
Problem is that when I merge in a different branch, the tool we use to merge makes GitHub think that this is closed instead of merged ... but it's merged 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for explanation. But it's merged only for old version? =(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes are "merged up" in all branches, so you can see the change from 2.7 (https://symfony.com/doc/2.7/bundles/best_practices.html) to 4.1 (https://symfony.com/doc/master/bundles/best_practices.html)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz Oh, thank you. Just the last question. If I'll make a new Pull Request next time, to which branch should I create pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeyPodgornyy We always merge PRs in the oldest maintained branch that is affected by a change. Currently, maintained Symfony versions are 2.7, 2.8, 3.3, 3.4, 4.0 and 4.1 (aka
master
).