Introduce EnumCast Behavior#162
Merged
Merged
Conversation
sukhwinder33445
force-pushed
the
introduce-enumCast-behavior
branch
from
June 25, 2026 08:13
6edd790 to
b7237a4
Compare
sukhwinder33445
force-pushed
the
introduce-enumCast-behavior
branch
3 times, most recently
from
June 25, 2026 08:52
1b3fd5f to
bd701c7
Compare
This behavior helps to convert backed-enum database values to and from PHP enum instances
sukhwinder33445
force-pushed
the
introduce-enumCast-behavior
branch
from
June 25, 2026 09:06
bd701c7 to
ae2ad98
Compare
nilmerg
approved these changes
Jun 25, 2026
sukhwinder33445
added a commit
to Icinga/icinga-notifications-web
that referenced
this pull request
Jul 15, 2026
Introduces a Severity backed enum that centralises all severity logic — backing values, translated labels, and icons — in one place, replacing scattered string constants in Icons and inline match expressions in the renderers. Wires up EnumCast on Incident and IncidentHistory so the severity column is hydrated directly as a Severity instance, turning raw string comparisons like `$item->severity === 'ok'` into type-safe `$item->severity === Severity::OK`. Also updates the `SEVERITY_OK` icon from `heart` to `circle-check` for visual consistency with the other severity levels. resolves #479 require Icinga/ipl-orm#162
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.
This PR introduces
EnumCast, a behavior that converts backed enum database values to and from PHP enum instances.