Ticket #3982 (closed enhancement: fixed)

Opened 2 years ago

Last modified 4 months ago

PHPdoc effort for post.php

Reported by: m0n5t3r Assigned to: anonymous
Priority: low Milestone: 2.6
Component: Optimization Version:
Severity: trivial Keywords: phpdoc has-patch commit
Cc:

Description

documented post.php functions

Attachments

post-phpdoc.diff (16.5 kB) - added by m0n5t3r on 03/16/07 19:33:39.
post.php phpdoc take 1
post.phpdoc.diff (37.5 kB) - added by darkdragon on 10/22/07 06:11:08.
Based off of the old patch and adds @since based off of http://planetozh.com/projects/wordpress-functions-history/table_light.html. Incomplete, but has param and return information
post.phpdoc.r8202.diff (15.7 kB) - added by jacobsantos on 06/27/08 11:52:18.
Post phpdoc fixes for post.php based off of r8202

Change History

03/16/07 19:33:39 changed by m0n5t3r

  • attachment post-phpdoc.diff added.

post.php phpdoc take 1

03/16/07 19:34:31 changed by m0n5t3r

  • type changed from defect to enhancement.

03/31/07 22:35:46 changed by jhodgdon

  • keywords changed from has-patch needs-testing 2nd-opinion to has-patch needs-testing 2nd-opinion developer-feedback.

I think it is a great idea to add documentation to the PHP functions of WordPress, if it is correct and descriptive.

However, there are two proplems with the proposed patch, in my opinion:

1) Not all the doc is correct (I think). For instance, the first function I believe returns the attachment's file name, but the doc says "returns meta data", which is sort of true but not very specific. The second function doc is similarly misleading.I sort of stopped reading at this point, so I'm not sure how many other functions are not correctly documented.

2) Style: the descriptions are too short, and the "return" sections give the data type but not a description of what the value is. The style is also inconsistent. I suggest going to java.sun.com and reading their notes on how to create good API doc.

My recommendation is to reject this patch as-is, and rewrite it to be better documentation. It is better to have to read the code than to be mislead by a function header, in my opinion. And if you're going to the trouble of putting in function header documentation, it should be good documentation.

04/01/07 02:03:57 changed by m0n5t3r

randomly ordered points:

  • I did try to get the return types and what the functions do right, but really the best one to document a function is the person who wrote it, as sometimes names are misleading (get_attachment_metadata seems to return an array with more than the file name, though)
  • the patch is here for review and correction, and possibly a good starting point for people who are far more familiar with the guts of wordpress than me
  • documenting 50 functions (that's the number I am getting from a quick grep on post.php) is a scary task if you do it from scratch; I think this one took me about 5 hours, and this with a lot of automation help from vim - getting function args, hook calls, etc;
  • inline documentation is far more useful for automated parsing (eclipse for instance shows the phpdoc info in some sort of a a menu, that's why I didn't start to write novels in there (partially, the other reasons being fatigue and laziness), that's the codex's job IMO
  • novel-style documentation would hurt more than no documentation at all (have you tried to read and make some sense out of a heavily commented java/c++/PEAR class?)

(please pardon my possible lack of coherence and solid arguments, it's almost 5 AM here)

09/12/07 02:54:41 changed by ryan

  • milestone changed from 2.3 to 2.4 (next).

10/15/07 22:56:05 changed by ryan

  • keywords changed from has-patch needs-testing 2nd-opinion developer-feedback to has-patch needs-testing 2nd-opinion developer-feedback phpdoc.

10/22/07 06:11:08 changed by darkdragon

  • attachment post.phpdoc.diff added.

Based off of the old patch and adds @since based off of http://planetozh.com/projects/wordpress-functions-history/table_light.html. Incomplete, but has param and return information

10/22/07 06:17:24 changed by darkdragon

  • keywords changed from has-patch needs-testing 2nd-opinion developer-feedback phpdoc to has-patch commit phpdoc.
  • component changed from Administration to Optimization.

Another five hours spent on documenting this file. Would have been more if not spending some time moving the old patch and getting it to work with the current commit revision.

Massively incomplete, lacking long descriptions and descriptions of some parameters and most return types. A good running start. I'll go over the documentation some time this week, after I pay some more attention to taxonomy.php (which is almost done) and widgets.php (not even close to being done, but I'll most likely at least document the parameters and return values).

12/10/07 06:59:03 changed by darkdragon

Bump.

Can this patch still go in? Let me know if it won't commit and I'll submit an updated patch.

12/14/07 00:28:34 changed by ryan

(In [6379]) post phpdoc from m0n5t3r and darkdragon. see #3982

12/14/07 00:33:25 changed by ryan

A few parts of the patch didn't apply cleanly.

Hunk #17 FAILED at 617.
Hunk #28 FAILED at 1189.
Hunk #32 FAILED at 1314.
Hunk #44 FAILED at 1742.

12/14/07 00:53:02 changed by darkdragon

Thanks. I will look at it today and fix it.

12/26/07 04:28:32 changed by darkdragon

  • summary changed from post.php inline documentation to PHPdoc effort for post.php.
  • milestone changed from 2.4 to 2.5.

01/11/08 18:39:37 changed by westi

  • keywords changed from has-patch commit phpdoc to phpdoc needs-patch.

06/27/08 11:51:37 changed by jacobsantos

  • priority changed from normal to low.
  • severity changed from normal to trivial.

06/27/08 11:52:18 changed by jacobsantos

  • attachment post.phpdoc.r8202.diff added.

Post phpdoc fixes for post.php based off of r8202

06/27/08 11:57:58 changed by jacobsantos

  • keywords changed from phpdoc needs-patch to phpdoc has-patch commit.

06/27/08 15:32:58 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [8203]) phpdoc updates for post.php from jacobsantos. fixes #3982