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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Status: Active » Needs review
FileSize
546 bytes

Patch attached.

Damien Tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Indeed.

jhodgdon’s picture

Status: Reviewed & tested by the community » Needs work

Could 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? :)

drunken monkey’s picture

Status: Needs work » Needs review
FileSize
1.93 KB
2.04 KB

As 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.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That 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!

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 8.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.