Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.baileys’s picture

Status: Active » Needs review
FileSize
683 bytes
mr.baileys’s picture

Component: simpletest.module » documentation

Moving to the documentation queue.

jhodgdon’s picture

Status: Needs review » Needs work

Good catch!

The patch needs a bit of work...

The first line of function doc needs to be less than 80 characters. This one is too long.

Also, if you're going to fix up this function doc, there is another line in there that needs 80-character wrapping, and there should be a blank line between the @param and @return sections in the function doc header.

Also, "Performs a cURL exec" is not really up to doc standards -- I can see that from the function name, but what does it mean?

How about (following how curl_exec() is documented on php.net):

Initializes and executes a cURL session.

(I don't think there's much value in the "with the specified options" stuff being in the one-line description -- of course it's going to use its parameters?)

mr.baileys’s picture

Priority: Minor » Normal
Status: Needs work » Needs review
FileSize
1.22 KB

The first line of function doc needs to be less than 80 characters. This one is too long.

Actually, the Doxygen formatting conventions say: one sentence on one line (should not, but can exceed 80 chars). I've seen some other summary lines in core exceed the 80 character limit. Not sure if this is still valid though, and since I agree with you that the "with specified options" part can go, this is not an issue in this case.

How about (following how curl_exec() is documented on php.net):

Initializes and executes a cURL session.

Better, but "executing a session" sounds weird to me. What about "Initializes and executes a cURL request"?

Also added in a @see reference to the list of valid options for $curl_options, a @see reference to the curlInitialize function and slightly reworded the return info.

jhodgdon’s picture

Status: Needs review » Needs work

My suggestion of "execute a session" came from the PHP.net documentation of cURL, but I agree that "request" makes more sense to me as well.

So, this patch is almost OK. But you cannot/should not put a @see in the middle of a @param doc. @see creates a See Also section in the doc. Just use the word "See" as you would in normal English -- all function names with () after them automatically turn into links anyway, and I believe URLs do too.

Also, if possible, we're trying to remove English-centric php.net links (there's a separate issue on that). So can you remove the "en" from the link, and verify that the link still takes you to the right page via php.net redirection?

"call to curl_exec." -- curl_exec() should have () after it -- it's a function. On some API sites, this will automatically generate a link to php.net (although not on api.drupal.org).

"@see curlInitialize" -- isn't this a method? If so, needs () after it to generate the link.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
1.22 KB

Thanks, new patch that fixes the remaining issues.

jhodgdon’s picture

Status: Needs review » Needs work

So I tried the URL referenced in $curl_options. And now I'm confused about $curl_options.... How is it being used and passed into the PHP function? Is it an associative array? I think it needs some additional documentation.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
1.31 KB

Fair enough. And to think this started out as a simple one-word fix ;)

New patch attached, see if it makes more sense. We could also include the fact that the options array is passed to curl_setopt_array(), but maybe that's going too much in detail.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me! Thanks for your willingness to make the documentation better. :)

realityloop’s picture

#8: curl-exec_1.patch queued for re-testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Well that's never good. :)

Committed to HEAD! Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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