framework icon indicating copy to clipboard operation
framework copied to clipboard

feat: add forget method to settings extender

Open OrdinaryJellyfish opened this issue 1 year ago • 1 comments

Fixes #3934

Changes proposed in this pull request:

  • Adds a forget method to settings extender. This method allows a callback returning a bool, which if returns true, deletes the setting so the default is used.

Reviewers should focus on:

  • Whether this new extender was written properly
  • If the forget method properly deletes a setting when callback returns true

Screenshot

QA

Necessity

  • [ ] Has the problem that is being solved here been clearly explained?
  • [ ] If applicable, have various options for solving this problem been considered?
  • [ ] For core PRs, does this need to be in core, or could it be in an extension?
  • [ ] Are we willing to maintain this for years / potentially forever?

Confirmed

  • [ ] Frontend changes: tested on a local Flarum installation.
  • [x] Backend changes: tests are green (run composer test).
  • [ ] Core developer confirmed locally this works as intended.
  • [x] Tests have been added, or are not appropriate here.

Required changes:

  • [ ] Related documentation PR: (Remove if irrelevant)
  • [ ] Related core extension PRs: (Remove if irrelevant)

OrdinaryJellyfish avatar Nov 23 '23 22:11 OrdinaryJellyfish

Sounds good to me!

OrdinaryJellyfish avatar Dec 01 '23 13:12 OrdinaryJellyfish