Page MenuHomePhabricator

StatusValue should be thoroughly encapsulated
Open, MediumPublic

Description

Background

Currently StatusValue has some member variables exposed externally, which destroys the encapsulation of this class.

$value
$success
$successCount
$failCount

We should access them via setter/getter.

Proposal

Protect above several member variables, and coding the corresponding setter/getter.

Benefit
  • Enjoy the benefits of encapsulation.
  • Reuse some code (e.g. we usually update $successCount when we update $success)
Cost
  • Many things depend on these member variables and require a lot of compatibility work.

Event Timeline

I hope the TC team can guide this task.

daniel subscribed.

Tagging CPT instead of TechCom, since this is not cross-cutting.

For the record, we have public members in quite a few places. They feel a bit dirty, but are not necessarily a problem.

WDoranWMF triaged this task as Lowest priority.Jul 9 2019, 6:38 PM
WDoranWMF raised the priority of this task from Lowest to Needs Triage.
WDoranWMF triaged this task as Medium priority.
WDoranWMF moved this task from Inbox to Icebox on the Platform Engineering board.