Opened 8 years ago
Closed 6 months ago
#7018 closed enhancement (fixed)
Properly declare all properties on classes
Reported by: | tw2113 | Owned by: | espellcaste |
---|---|---|---|
Milestone: | 14.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | good-first-bug has-patch |
Cc: |
Description (last modified by )
We have a number of classes available, whether internal or public for users, and that's wonderful. However, we have not always properly declared the properties that we set in the __construct()
methods or elsewhere in the class. We should work to change that fact.
Example from BP_Groups_Group:
/** * ID of the group. * * @since 1.6.0 * @var int */ public $id;
public function __construct( $id = null, $args = array() ) { $this->args = wp_parse_args( $args, array( 'populate_extras' => false, ) ); if ( !empty( $id ) ) { $this->id = $id; $this->populate(); } }
Attachments (2)
Change History (28)
#3
@
8 years ago
CHECK FOR MULTIPLE SPOTS
class-bp-activity-activity.php
{$bp->activity->table_name}
buddypress()->activity->table_name_meta
$bp->profile->table_name_data
class-bp-activity-component.php
buddypress()->plugin_dir
$bp->table_prefix
$bp->pages->activity->slug
buddypress()->my_account_menu_id
$bp->bp_options_title
$bp->bp_options_avatar
class-bp-activity-feed.php
Need to decide on visibility of properties
class-bp-activity-list-table
buddypress()->profile->name
#4
@
8 years ago
Some appear to be a part of BuddyPress::setup_globals(); which has a nice long note about protecting things and keeping part of the galaxy at peace.
#6
@
6 years ago
- Keywords needs-patch needs-refresh added
- Milestone changed from Awaiting Contributions to 5.0.0
@tw2113 This seems to be an interesting problem we could solve. Can you leave an update what's left on this one?
#7
@
6 years ago
Honestly probably most of it. I doubt I ever committed anything officially, instead just relied on the diff files above for extra review.
#8
@
6 years ago
- Keywords good-first-bug added
- Owner set to espellcaste
- Status changed from new to assigned
@tw2113 Can I ask how you generated this list here: https://gist.github.com/tw2113/b41f25858d0434e794284edd8db7c954 ?
And thank you for your feedback, I'll take from here. :)
#9
@
6 years ago
I most likely did a grep/ack/ag code search on the trunk branch and extracted out the results.
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
5 years ago
This ticket was mentioned in PR #54 on buddypress/buddypress by renatonascalves.
21 months ago
#12
- Keywords has-patch added; needs-patch needs-refresh removed
Trac ticket: https://buddypress.trac.wordpress.org/ticket/7018
renatonascalves commented on PR #54:
21 months ago
#13
@imath Initially, I was updating the types (i.e., bool
=> boolean
) per case/situation, but I'll introduce a future pull request with a change in the project. In this way, we account for everything.
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
19 months ago
#21
@
12 months ago
I have applied the patch from svn for all the Declarations. Everything looks good.
#22
@
10 months ago
- Milestone changed from 12.0.0 to Up Next
There are still a lot of work about this ticket, let's carry on during next release cycle.
Indeed