Opened 3 years ago
Closed 4 months ago
#8553 closed enhancement (fixed)
PHPDoc Improvements
Reported by: | espellcaste | Owned by: | |
---|---|---|---|
Milestone: | 14.0.0 | Priority: | normal |
Severity: | normal | Version: | 9.1.1 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
Placeholder ticket to hold all commits/changes related to PHPDoc to the 10.0.0 milestone.
PHPDoc changes only unrelated to any other ticket already in the milestone.
Change History (23)
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
3 years ago
#10
@
3 years ago
- Milestone changed from 10.0.0 to Up Next
Let's carry on working on this during next release
#12
@
2 years ago
- Milestone changed from 11.0.0 to Up Next
Not a lot of progress in this release. But carry the ticket on for the next release.
This ticket was mentioned in PR #48 on buddypress/buddypress by renatonascalves.
21 months ago
#13
- Keywords has-patch added
- As titled;
- Removing
$bp
when not used on the function/method; - Minor tweaks.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8553
This ticket was mentioned in PR #55 on buddypress/buddypress by renatonascalves.
21 months ago
#15
There are a lot of action callbacks being misused.
This pull request:
- removes the
@return
PHPdoc in functions without returned values, only with side effects; - remove boolean values from functions without returned values, only with side effects;
- Update
add_action
toadd_filter
where applicable.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8553
renatonascalves commented on PR #55:
21 months ago
#16
@imath I did some quick preliminary testing locally and didn't see any issues.
If you could check/test as well, that'd be great. 💯
my concern is if a plugin is using this function to actually get a returned value it might generate issues with it.
I agree! I have other ways (more verbose) to address the PHPDoc issues without changing the examples you raised.
But I still think those examples are incorrect, they should not be returning anything, since they are being used to register/instantiate classes to BuddyPress itself. So if anyone is using them, they are doing it incorrectly.
bp_notifications_delete_notifications_on_user_delete
is a good example. It currently has a side effect, AND it has a returned value. But when hooking into the do_action
, the returned value has no usage.
This I think was a flaw in the design (its usage). Making a getter/setter function and using it in a do_action
hook.
This ticket was mentioned in PR #56 on buddypress/buddypress by renatonascalves.
20 months ago
#17
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8553
This ticket was mentioned in PR #58 on buddypress/buddypress by renatonascalves.
20 months ago
#19
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8553
20 months ago
#20
Hi @renatonascalves
I tested things I had a concerned about. No side effects, so it's good to go. About bp_notifications_delete_notifications_on_user_delete()
I've added a suggestion to deal with it. Thanks again for your work on it.
renatonascalves commented on PR #55:
20 months ago
#21
@imath Could you give another pass/look?
Congrats for opening this ticket, there are a lot of missing DocBlocks in BP Nouveau 😬