Closed (duplicate)
Project:
Drupal core
Version:
9.2.x-dev
Component:
documentation
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Feb 2017 at 10:48 UTC
Updated:
20 Apr 2021 at 07:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
agoradesign commentedComment #3
agoradesign commentedComment #4
mondrakeLooks good. Patch is doc change only.
Comment #5
xjmGood spot on the missing parameter documentation.
It should say "minimum" and "maximum" (which have slightly different meanings than "minimal" and "maximal"). We should use the full word instead of "min" and "max" later in the description as well.
The sentences are also kind of a run-on. We should split it into two sentences.
Finally, is there an existing description of data in this width x height format elsewhere in core that we should make it consistent with? The square brackets can confuse users since we are using them to denote "replace '[width]' with the number" but that is not actually clear or consistent. In general we should avoid such pseudo-delimiters because users can think they are part of the actual string format.
Actually this also calls into question why we do not allow passing separate min_width, min_height, max_width, and max_height parameters rather than this weird special string format. :) But that is out of scope for this issue, so would need to be discussed in a followup if anything.
Also, thinking about the scope of this issue in terms of: https://www.drupal.org/core/scope#coding-standards
This issue is adding missing parameter documentation. While missing parameter documentation is itself a coding standards error, adding that documentation needs to be done by writing it, which means understanding the concepts involved. So the current scope of this patch, limited to one concept, also makes sense.
However, we should make sure we're adding all the missing parameter documentation for this specific concept. Can we check whether there is any other missing documentation in the Random component? Writing that documentation together would work best.
Thanks @agoradesign!
Comment #6
himanshu-dixit commented@xjm Here is the new patch.
I found file which have existing description of data in this width x height format. The file is file.module :) .
Comment #7
agoradesign commentedThe quick reactions to this tiny issue are awesome :) thx @xjm, @himanshu-dixit
I agree, that we should think of that parameters in general, as there are way better solutions. We could introduce value objects or at least use arrays with "width" and "height" parameters directly, as these are normally the way we work with image dimensions in Drupal afaik. E.g. there's ImageStyle::transformDimensions, where such an array is used.
@xjm: I've one interesting question left about issues like this one. As you can see in the issue's revision, I was rather unsure, which component to choose for this issue. On the one hand it's kinda documentation related, as phpdoc comments are part of the API documentation. But there are also valid arguments to choose the subsystems. I've changed it from "documentation" to "base system", after berdir answered to my question on IRC and gave me this advice
Comment #14
tanubansal commentedTested via #6.
It's showing the added text. This can be moved to RTBC
Comment #16
quietone commentedA description for these parameters was added in #3076644: Mistake in the comment documenting the "image" method of the "Random" utility class.. The text is different than what is in the patch, but the meaning is the same. Closing as a duplicate.