-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update standards to match actual practices #5838
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
Conversation
I agree with your second idea. Instead of removing the phrase, let's improve it:
|
5e8dc36
to
d589da5
Compare
Updated with the phrase you suggested. |
I'm 👎 for this for one reason:
This is not accurate at all. We should precise when the comment should be here, and when not. For example, basic getter could / should have a phpdoc to precise the type. This is used by most of the IDE. |
I think almost all methods (even simple getters and setters) are documented in Symfony core. I agree that it isn't enforced as strict as other standards, but I still think we should keep the standard as it is. However, Symfony tends to seperate public API from internal methods/properties/classes more and more. Many methods that don't have any PHPdoc are internal methods (e.g. event listener methods). Maybe we should update this to "Add PHPDoc blocks for all classes, methods, and functions that are part of the public API;" What do you think? |
Well, actually we indeed usually do reject adding "useless" PHP doc. |
What would be really helpful and clear to ready would be some examples. E.g. Correct commenting// type is obvious from typehint - no need for that to duplicate
public function setPerson(Person $person)
{
// ...
}
// param is unknown scalar type - add new information
/**
* @param int $count
*/
public function setCount($count)
{
}
// returns unknown scalar type - add new information
/**
* @return bool
*/
public function isReady()
{
// ...
} Incorrect commentingUsecases you are talking about... |
What should we do with this proposal? I don't think we can put this in words with absolute precision because adding or not some PHPdoc is sometimes subjective. I'd merge it as is. |
* 3.2: [#8195] fix requirement checker binary Simplified the requirements article [#6030] Simplifying and showing code Clearify behaviour of Blank and NotBlank validator [#5838] Tweaking comment - the phpdoc policy is not concrete Update standards to match actual practices Updated the Requirements article for Symfony 3.2 Updated the Requirements article for Symfony 2.8
* 3.3: [#8195] fix requirement checker binary Simplified the requirements article [#6030] Simplifying and showing code Clearify behaviour of Blank and NotBlank validator [#5838] Tweaking comment - the phpdoc policy is not concrete Update standards to match actual practices Updated the requirements article for Smyfony 3.3 Updated the Requirements article for Symfony 3.2 Updated the Requirements article for Symfony 2.8
* 3.4: [#8195] fix requirement checker binary Simplified the requirements article [#6030] Simplifying and showing code Clearify behaviour of Blank and NotBlank validator [#5838] Tweaking comment - the phpdoc policy is not concrete Update standards to match actual practices Updated the Requirements article for Symfony 3.4 Updated the requirements article for Smyfony 3.3 Updated the Requirements article for Symfony 3.2 Updated the Requirements article for Symfony 2.8
* origin/3.3: [#8195] fix requirement checker binary Simplified the requirements article [#6030] Simplifying and showing code Clearify behaviour of Blank and NotBlank validator [#5838] Tweaking comment - the phpdoc policy is not concrete Update standards to match actual practices Updated the requirements article for Smyfony 3.3 Updated the Requirements article for Symfony 3.2 Updated the Requirements article for Symfony 2.8 removed Charles Updated the Core Team information added CVE 2017-11365 added URL where to ask for a CVE identifier add missing choices_as_values options Update usage.rst
We don't add phpdoc if it doesn't add any meaningful information, so i removed the line saying all methods should be documented. Maybe we should replace it by a phrase explaining what should be documented ?