Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2011 at 05:43 UTC
Updated:
29 Jul 2014 at 20:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
pillarsdotnet commentedThat
@paramtype should bemixed, notstring.Comment #2
jhodgdonSeveral problems here:
I don't think we use "Class object" anywhere else in the code. Should probably just say "Returns a new Archive_Tar object." Class seems redundant to me, and it definitely shouldn't be capitalized if it is used.
Please use the name of the parameter, which I think is $p_compress. It is more precise than "the compress argument". Also, this information should be in the @param section, not in the general function header, as it is specific to that parameter.
Does not end with a period.
One space between sentences, not two. Start with the parameter description, then put the allowed values. Don't say "this parameter indicates", just say "Indicates". Probably you can combine the "Can be ... TRUE" with the explanation of what TRUE means, something like:
Possible values: NULL, 'gz', 'bz2', or TRUE (equivalent to 'gz').
Actually, these would be even better as a list that explains what they mean.
Comment #3
lars toomre commentedThe '@param mixed' style also needs to be changed to the preferred format '@param NULL|bool|string'.
Comment #4
pillarsdotnet commentedRe-rolled as requested.
Actually, just about every docblock in the entire file is non-compliant, because it was imported from PEAR with only minor edits. But as webchick says, "When in doubt, do what PEAR does."
Comment #5
lars toomre commentedHowever, a zero byte patch will not change anything!
Comment #6
pillarsdotnet commentedBah! Sorry.
Comment #7
lars toomre commentedReading the revised docblock documentation, I wonder what will happen if one were to specify $p_compress as FALSE. This is no fault of the revised documentation. However, it points out the problem with partial/incomplete code paths. Could this be revised to be more clear?
Comment #8
pillarsdotnet commented(sigh)
Since
FALSE == '', I would say thatFALSEis treated the same way asNULL; i.e. "No compression is required."Re-rolled; the more I look at the code in this file the less I like it, but jhodgdon said:
So I won't try.
Comment #9
jhodgdonOne more thing I just noticed -- the /** and the * lines do not line up according to our standards on this function.
And this line still needs a period at the end:
Also, the standards at http://drupal.org/node/1354#functions do not include "true|false" but instead "bool" for return value docs. I am not sure what we should do about NULL though -- using a lower-case "null" doesn't seem right, but we don't have a standard...
Comment #10
pillarsdotnet commentedRe-rolled. You do realize, of course, that every single docblock in that file has the same problem. But we're only going to fix the one. I should open separate issues for each of the other ones, with a day or two delay between each one. Maybe webchick won't notice. ;->
Thanks for answering question #3 in #711918-56. (recording for future reference...)
Okay; I dunno what to do about NULL either. Seems to me that would be a case for using
mixedbut I'm just a confused neophyte, not a rule-maker.Comment #11
lars toomre commentedThere are several functions in core that have a @return profile of whatever (string, int, object) | FALSE | NULL. How should these be documented when TRUE is never returned and hence should never be considered a valid return value? In such cases, FALSE seems more appropriate than bool.
In this case though, it seems like '@return bool' is appropriate since both are valid return values.
Comment #12
pillarsdotnet commentedWhat? it returns an
Archive_Tarobject, notTRUEorFALSEComment #12.0
pillarsdotnet commentedLinked to relevant section of coding standards.
Comment #12.1
pillarsdotnet commentedAdded the remaining gripes.
Comment #13
pillarsdotnet commentedOh; I see. you were talking about
@paramnot@return.Re-rolled again. Shame, shame, shame on me for ever thinking I could get this right in one try.
Comment #14
jhodgdonSee http://drupal.org/node/1295500#comment-5068622 for a discussion of the reformatting (in this case, I would only reformat the docblocks for the file at a time when disruptions are OK, or on an individual basis when there is a doc problem)....
Come to think of it, this whole issue is just about formatting of that one docblock anyway. Maybe we should postpone this whole reformat, and do the whole file at once, during the first week in November?
Sigh. If the people who added this to Drupal Core had followed the standards in the first place....
Comment #15
pillarsdotnet commentedThis file was basically copied from PEAR sources, and as webchick says, "When in doubt, do as PEAR does."
I get the impression that it was originally supposed to be as close to the original PEAR source as possible, so that if/when the upstream PEAR sources get updated, it would be easy to merge the updates here, as well.
Comment #16
jhodgdonAngie/webchick may say "when in doubt, do what PEAR does", but our expressed doc/coding standards are not the same as that project's doc standards.
Anyway, if we're trying to maintain this to be the same as PEAR as possible, then we should just leave it as-is and maybe put a note at the top of the file noting that? I'm sure we don't alter JQuery files and other things that we import from other projects... we probably shouldn't alter this either, but just be aware that it isn't "our" code?
Comment #17
pillarsdotnet commentedDunno. PEAR is pretty stagnant; I imagine that the original expectation that we would be updating from it is probably unfounded. But yes, this should be discussed.
Comment #18
jhodgdonCan you ping someone with authority on this in IRC to get some opinions on whether we should be trying to update any coding/docs standards in this section of the code then? Postponing until I hear back...
Comment #19
pillarsdotnet commentedIt looks like this was discussed in #870204: Revert coding style changes to system.tar.inc & other externally developed files
Comment #20
pillarsdotnet commentedPinged sun -- setting to "won't fix" until I get a response, since it appears a decision has already been made.
Opened #1298304: [Meta] Move all externally-developed files to core/vendor/{vendorname}/ directories
Comment #20.0
pillarsdotnet commentedLink to the current patch.