On #2148255: [meta] Make better D8 api.d.o landing page, linked to high-level overview topics, and put it in Core api.php files, we made a patch that included a stub Topic page for api.drupal.org (i.e., a @defgroup) titled:
Object-oriented programming conventions
This can be found in file core/modules/system/core.api.php where it says
@defgroup oo_conventions
The documentation to go on this page needs to be written. The idea is:
a) Write a few paragraphs about the topic.
b) Link to more detailed documentation on
https://drupal.org/developing/api/8
c) If the more detailed documentation does not yet exist, create stub page(s), link to the stub pages, and add a note to this issue stating that the stub pages need to be filled out.
d) If the topic has related classes, interfaces, and functions -- appropriate for an overview -- add
@ingroup oo_conventions
to their documentation headers. That will make these classes etc. show up on the Topic page on api.drupal.org. Only include classes/functions that are appropriate for an overview page please!
For more info -- documentation standards for @defgroup/@ingroup:
https://drupal.org/coding-standards/docs#defgroup
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2216563-oo-docs-4.patch | 2.56 KB | jhodgdon |
Comments
Comment #1
jhodgdonTaking this on...
Comment #2
jhodgdonI think this, for a change relatively short, patch is probably enough for this topic. Thoughts?
Comment #3
webchickSo my one beef with this is it puts the most critical information (you need to put your classes just so or nothing happens) at the end, and emphasizes the least critical (FYI, we have coding standards for this) at the top. Personally, I would more or less invert the list:
Something like that.
Additionally, while I definitely don't want to duplicate documentation found elsewhere here, it'd be nice if we could point to a reference (off-site or otherwise) that explains what the heck these newfangledy words (class, interface and especially trait) are. Not just for D6/7 > D8 migrators, but for PHP devs in general who've come from a procedural background.
Comment #4
jhodgdonGood point. I adopted ... close to this ordering, see what you think.
Also added an @link to the php.net docs section on OO programming. Good idea.
I could make an interdiff but it's the same size pretty much as this patch... so just uploading the patch.
Comment #5
webchickAwesome, that looks great to me.
Since this was just a simple re-ordering of what was already there + the addition of a new link, I feel comfortable going ahead and committing this since it's already been at needs review for about a week.
Committed and pushed to 8.x. Thanks!