Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enums as setting keys #37

Merged
merged 4 commits into from
Oct 1, 2023
Merged

Enums as setting keys #37

merged 4 commits into from
Oct 1, 2023

Conversation

rawilk
Copy link
Owner

@rawilk rawilk commented Sep 29, 2023

PHP's native enums can make a great way to use and keep tracking of the settings available in an application. This PR adds the possibility to use an enum as a key instead of a raw string in the following methods on the setting service:

  • get
  • set
  • has
  • forget
  • isTrue
  • isFalse
  • cacheKeyForSetting

These methods will still accept strings, but now they also accept string backed enums as well.

@rawilk rawilk added the enhancement New feature or request label Sep 29, 2023
@rawilk rawilk merged commit 1b6c576 into main Oct 1, 2023
@rawilk rawilk deleted the feature/backed-enum-key branch October 1, 2023 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant