Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Current doc comment for Drupal\Component\Uuid\UuidInterface::generate()
:
/**
* Generates a Universally Unique IDentifier (UUID).
*
* @return
* A 32 byte integer represented as a hex string formatted with 4 hypens.
*/
This is wrong, UUIDs have only 16 bytes, represented as 32 hexadecimal characters and four hyphens.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2046951-4--uuid_byte_count.patch | 2.04 KB | drunken monkey |
#4 | 2046951-4--uuid_byte_count--no_newlines.patch | 1.93 KB | drunken monkey |
#1 | 2046951-1--uuid_byte_count.patch | 546 bytes | drunken monkey |
Comments
Comment #1
drunken monkeyPatch attached.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedIndeed.
Comment #3
jhodgdonCould we also correct the spelling of "hypens" at the end of that line (hopefully you agree this is not really out of scope for this one-line patch issue)? :)
Also, at least one of the classes that extends this interface has the same problem in the docs, so could we either fix those too or (better yet) change them to use @inheritdoc so if there are other updates to the interface docs they will get the correct docs?
https://drupal.org/node/1354#inheritdoc
I think this is within the scope of at least the title of this issue too... please? :)
Comment #4
drunken monkeyAs you wish. ;) I didn't find any other comments stating UUIDs have 32 bytes, but I changed all implementing classes to use
{@inheritdoc}
nevertheless.While at it, I also unified the newlines before the first and after the last methods in the class and interface, at least for those four files. The coding standard regrettably don't specify anything (that I could find) so it seems it's rather chaotic at the moment.
In case that is out of scope for the issue, I also provided a second patch without those newline changes.
Comment #5
jhodgdonThat second ("no newlines") patch looks fine to me, thanks! I don't believe we have a standard about having or not having a blank line before the end of a class.
Now that I see the patch, I see why api.drupal.org was displaying the "32 byte" information on the extending classes: a missing doc block is treated the same as {inheritdoc} by the API module, and quite a few of those methods were missing doc blocks. So that explains it.
Thanks!
Comment #6
jhodgdonThanks again! Committed to 8.x.