1

I've got two functions at the moment:

suspendGroupsAndUsers($groupId){}
enableGroupsAndUsers($groupId) {}

But the difference between the two is one variable/string. Should I just have:

setStatusGroupsAndUsers($status,$groupID) {}

This feels more DRY... Or have the above two functions actually call the setStatus function?

Gut says use setStatus ...

1

If your status can eventually become something else than a boolean value (enabled, suspended, hidden, banned, etc.), you may have to refactor if you only use setStatus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.