feat: add BackedEnum support and housekeeping improvements#99
Open
enricodelazzari wants to merge 14 commits intomaize-tech:mainfrom
Open
feat: add BackedEnum support and housekeeping improvements#99enricodelazzari wants to merge 14 commits intomaize-tech:mainfrom
enricodelazzari wants to merge 14 commits intomaize-tech:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BackedEnum support
MarkValueclass withresolve()to normalizeBackedEnum|string|nullto?stringMarkValue::resolveAll()to normalize arrays, eliminating duplicated inline logic inhasAllowedValues()Markpublic methods (add,remove,count,has,toggle,hasAllowedValues) andMarkable::scopeWhereHasMark()to acceptnull|string|\BackedEnuminstead of?stringallowed_valuesconfig (resolves all cases automatically)tests/Enums/ReactionType.phpand corresponding test coverage for all enum-based flowsCentralize config access via
Support\Configsrc/Support/Config.phpwith typed static methods (getUserModel,getTablePrefix,getAllowedValues)config('markable.*')calls inMark.phpandMarkable.phpHousekeeping
tests/Pest.php,pestphp/pest)phpstan.neon.dist,analyse.ymlworkflow)spatie/laravel-rayfrom dev dependencies.claude/to.gitignoreTest plan
composer test— all 36 tests passcan_add_a_reaction_with_backed_enumcan_has_a_reaction_with_backed_enumcan_remove_a_reaction_with_backed_enumcan_toggle_a_reaction_with_backed_enumcan_count_reactions_with_backed_enumcan_use_enum_class_as_allowed_valuescannot_add_invalid_value_when_allowed_values_is_enum_class🤖 Generated with Claude Code