-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
This helpers would simplify checks under special conditions.
Let's say the we have an enum PublishingState
with the values DRAFT
, PUBLISHING
, PUBLISHED
.
is()
if ($post->state->is(PublishingState::DRAFT())) {
...
}
is<EnumValue>
and in extension a dynamic method is<EnumValue>
:
if ($post->state->isDraft()) {
...
}
The benefit of this especially would be an enhanced readability.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request