Problem/Motivation
Improve documention in \Drupal\Component\Utility\Unicode::truncate
Steps to reproduce
Proposed resolution
Add optional to the descriptions for $wordsafe, $add_ellipsis, and $min_wordsafe_length.
Refer to the latest patch which has already made the change.
Remaining tasks
Move the documentation changes in the latest patch to an MR.
User interface changes
API changes
Data model changes
Release notes snippet
Original report
I assume that we are now in code cleanup phase. I use PhpStorm to find possible bugs and problems in the Drupal 8 core. Normally I will not alter code flow. If I find problems in a file, which I will not fix, but find suspicious. I'll mention it in the text here.
For changes in the PHP Documentation I use this node as guide: http://drupal.org/node/1354
Checked: unicode.inc file.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drupal_core-code_cleanup_doc_cleanup_of_unicode.inc-1965508-1.patch | 8.16 KB | ro-no-lo |
Issue fork drupal-1965508
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:
- 1965508-improve-doc-block
changes, plain diff MR !7990
- 1965508-improve-doc-blocks
changes, plain diff MR !11746
Comments
Comment #1
ro-no-lo commentedPatch added
Comment #2
enhdless commentedPatch fails to apply, it should be rerolled.
Comment #15
quietone commentedThis is still valid and is suitable for a first issue.
Comment #16
ro-no-lo commentedWith the latest PHP 8.x I think we could avoid many of these phpDocs by just using the types inside the method signature.
Comment #20
jcorraoI have gone through and reviewed the patch file from #1 and ported the changes to the relevant counterpart in the 11.x codebase.
The type declarations in the PHPDoc patch were present in 11.x already, however they were missing the `(optional)` declaration as described in the linked PHP Documentation Standards page: http://drupal.org/node/1354
MR !7990 is published and ready for review.
Comment #21
smustgrave commentedSo re-ran the tests but getting many failures and not sure why with just comments.
Comment #22
smustgrave commentedBelieve the issue has been fixed but just needs a rebase.
Comment #26
isa.belI rebased the current branch using the latest version of core. Ready to be reviewed
Comment #27
smustgrave commentedBelieve this is a net improvement.
Comment #28
xjmAdded
(optional)and the wrapping look correct. The only thing is that we have a pattern of describing the default behavior of optional parameters, e.g. "Defaults to FALSE" (and what that means for the behavior if the docblock doesn't already say). This is useful when the PHPDoc is being read outside the context of the codebase. Can we add that to these three parameters?Thanks!
Saving credits.
Comment #30
nexusnovaz commentedI've added some descriptions, i think this is good for review.
Thanks.
Comment #31
xjmI think those look great, thanks @nexusnovaz!
Comment #32
smustgrave commentedBelieve feedback for this one has been addressed (sorry fell off my radar)
Comment #34
quietone commentedI read the changes and they read well, the changes asked for by xjm have been made. They are no unanswered questions.
This is definitely an improvement. Thanks.
Committed 3c8dd1c and pushed to 11.x. Thanks!