Opened 13 years ago
Closed 13 years ago
#27083 closed defect (bug) (fixed)
PHPDoc updates for wp-includes/comment-template.php
| Reported by: | DrewAPicture | Owned by: | DrewAPicture |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | Comments | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | docs |
Description
This ticket is a followup to #20495. Patch attached.
Attachments (2)
Change History (9)
#3
follow-up:
↓ 4
@
13 years ago
- Resolution fixed
- Status closed → reopened
$end-callback looks weird as a PHP variable due to the hyphen. My initial thought was to change it to $end_callback, however 'end-callback' is the actual value used in Walker_Comment::end_el():
tags/3.8.1/src/wp-includes/comment-template.php#L1660
Do we need for all string parameters to look like PHP variables?
#4
in reply to: ↑ 3
;
follow-up:
↓ 5
@
13 years ago
Replying to SergeyBiryukov:
$end-callbacklooks weird as a PHP variable due to the hyphen.
<snip>
Do we need for all string parameters to look like PHP variables?
All arguments in a hash notation need to be expressed as variables per the standard.
However, I don't think we necessarily need to keep the hyphen for the purposes of the docs -- I don't have a problem with changing it to an underscore there.
#5
in reply to: ↑ 4
;
follow-up:
↓ 6
@
13 years ago
Replying to DrewAPicture:
All arguments in a hash notation need to be expressed as variables per the standard.
I see, thanks for clarifying that.
However, I don't think we necessarily need to keep the hyphen for the purposes of the docs -- I don't have a problem with changing it to an underscore there.
I think that might cause a confusion with someone trying to pass 'end_callback' instead of 'end-callback' and wondering why it doesn't work. Could we perhaps add some kind of a comment there, like 27083.2.diff?
#6
in reply to: ↑ 5
@
13 years ago
Replying to SergeyBiryukov:
I think that might cause a confusion with someone trying to pass
'end_callback'instead of'end-callback'and wondering why it doesn't work. Could we perhaps add some kind of a comment there, like 27083.2.diff?
I think at a certain point, this becomes an exercise in futility :) I'm thinking we should just leave the hyphen in, rather than modify it here and make a note about why it was modified over there, etc. Seems like overkill.
#7
@
13 years ago
- Resolution → fixed
- Status reopened → closed
After reading more about hash notation, I see that although variable names require the $ sign, it does not mean they're supposed to be interpreted as PHP variables. So I'm fine with [27156] as is, sorry for the confusion.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
All the docs + standards