Problem/Motivation
The documentation style of that file should be fixed, see https://www.drupal.org/node/1354
Proposed resolution
Beta phase evaluation
| Issue category | Task as it is a coding standards cleanup with no functional bug.. |
|---|---|
| Issue priority | Minor as it is only a coding standards cleanup in one file and does not significantly impact code legibility or maintainability. |
| Unfrozen changes | Unfrozen because it only changes docmentation. |
Remaining tasks
Needs work
User interface changes
No
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #46 | 2478355-3.patch | 2.25 KB | beatrizrodrigues |
| #45 | 2478355.patch | 2.31 KB | beatrizrodrigues |
| #34 | interdiff-2478355-33-34.txt | 3.27 KB | leeotzu |
| #34 | fix_documentation_style-2478355-34.patch | 7.7 KB | leeotzu |
| #33 | interdiff-2478355-32-33.txt | 2.63 KB | leeotzu |
Issue fork drupal-2478355
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
xjmNote that in general, coding standards cleanups are not in scope during the beta, but patches that only touch documentation are unfrozen, so this is okay to work on. Thanks!
Comment #2
xjmComment #3
pixel5 commentedI am new to documentation standards, so forgive me if I'm not seeing everything. The only issue I can see right off is lines 101 and 149 where the comment goes past 80 columns. Is that everything wrong with it?
EDIT: Disregard. Found my answer.
Comment #4
disasm commentedHere's a patch to get this started.
Comment #5
leeotzu commentedComment #6
leeotzu commentedAs per the patch https://www.drupal.org/node/2478355#comment-9907191, the patch didn't worked. Please find the log message:
Comment #7
leeotzu commentedPlease find the updated patch for review.
Comment #8
umarzaffer commentedWhile reviewing this patch I:
1. Downloaded and applied this patch successfully.
2. Manually reviewed the changes and have listed down the findings below -
Remove extra empty line.
Remove extra empty line.
This function rather seems to Set the next record rather than getting one. I think the documentation should suggest that this function 'Sets the next record.'
Mark all params of fetchAll as optional.
Comment #9
leeotzu commented@umarzaffer. Appreciate your review comments.
Remove extra empty line. As per the documentation https://www.drupal.org/node/1354#var class declaration is followed by a blank line.
This method does not gets the next record, rather it return the current record.
Rest of the changed are applied as per suggestion.
Comment #10
leeotzu commentedComment #11
AsianBot commentedGood work @leeotzu. I have validated the reviews given by umarzaffer.
All seems good
Moving this to RTBC
Comment #16
manjit.singhI think test has passed .. so moving to RTBC based upon #11 review by @AsianBot.
Comment #17
alexpottIt's good see some documentation work going on in a part of the system that doesn't get many people looking at it...
This looks odd. I think we just need to remove the comment and add
to document the
key()method.Just needs to be
these are documented on the IteratorInterface.
I can't find what this is inheriting from.
Needs an new line in between.
StatementPrefetch::current().$class_name = array_unshift($this->currentRow);looks broken since unshift is supposed to add something on to an array andreturn $this->currentRow[$k][$this->columnNames[$this->fetchOptions['column']]];I'm not sure how$kcan be defined. Can someone check if there is an existing issue and if not file a new issue to address an test this.Comment #18
manjit.singhComment #19
manjit.singhI have done the 1, 2, 4 changes as Alex suggested
@leeotzu Can you Please look into the 3rd and 5th point in #17
Comment #20
leeotzu commented@alexpott: Your observation about unresolvable {@inheritdoc} is right. This is due to the fact that public function fetch in class StatementInterface is commented.
Initialisation of the variable $k is missing in public function current()
Comment #21
Crell commentedThe line noted in #17.5 is definitely broken, no question. However, this class is only used by the SQLite driver, and that particular fetch mode is almost never used in core. That's why it's not been caught.
I have filed a separate bug here: #2499875: Fix bug with prefetch drivers and FETCH_CLASS.
Comment #24
leeotzu commentedThe last test as per #19 passed. Moving to RTBC
Comment #25
alexpottRe #17.3 and #20. If it is commented then
{@inheritdoc}is incorrect. Why is it commented?Comment #26
leeotzu commented@alexpott, I checked the commented method public function fetch in , it seems to have commented by Larry Garfield on 2011-12-27.
IMHO, public function fetch($fetch_style = NULL, $cursor_orientation = \PDO::FETCH_ORI_NEXT, $cursor_offset = NULL) does not need second and third parameter defined in the file StatementPrefetch.php.
Comment #27
leeotzu commentedComment #28
bojanz commentedShould be "Creates a new StatementPrefetch instance." - core generally prefers that style nowdays.
We need an empty line before @return.
It's generally a good idea to use the verb from the method name. Other fetch methods in the same patch use the "Fetch" verb, we should do the same here (instead of "Returns") to make it consistent.
Comment #29
leeotzu commented@bojanz: Thanks for a quick review of the patch. Please find the updated the patch file as per your suggestion.
Comment #30
umarzaffer commentedCouple minor observations-
Mark $index as Optional.
Also, does it make sense to specify explicitly that if no value is specified then by default first column would be returned?
Replace $mode with $fetch_style.
Comment #31
umarzaffer commented.
Comment #32
leeotzu commented@Umar, thank you sharing you observations. Updated the patch file.
Comment #33
leeotzu commentedMinor fixes to the patch, which was missed in earlier comment patch.
Comment #34
leeotzu commented@bojanz : Thanks for sharing your observation over IRC. Modified the patch accordingly.
Comment #35
yesct commentedJust a review on the interdiff.
the indent on this line was fine. ( should be under the a in @param
https://www.drupal.org/node/1354#param
then you should probably make it cased correctly also.
https://www.drupal.org/node/1354#return
pattern would recommend something more like.
but that is not super useful.
maybe try and say what the object is, and when it returns false.
here is an example where it says when it returns false.
Comment #44
beatrizrodriguesI'm working on this issue, I'll apply the patch before at the current version and fix the remaining problems related at #35.
Comment #45
beatrizrodriguesHere is my patch.
I did the reroll from the comment #34 applying the modifications at the most recent drupal version. Changing to needs review.
Comment #46
beatrizrodriguesFixed the phpcs errors.
Comment #47
anagomes commentedNew patch passed in all tests, small changes applied in the latest version, it all looks good to me.
Comment #48
quietone commented@beatrizrodrigues and @anagomes, Welcome to Drupal! Thank you for working to bring Drupal code up to standards.
However, we have a number of issues dealing with coding standards fixes and the community has decided that the best way to approach this is by fixing a rule at a time, rather than a file at a time.
Please see #2571965: [meta] Fix PHP coding standards in core, stage 1 where this effort is being organized. There you can find a variety of coding standard issues to work on.
The work adding a function doc block is part of #3212066: [meta] Fix Drupal.Commenting.FunctionComment.Missing . Closing this as a duplicate of that one.
Comment #49
beatrizrodriguesthank you, @quietone