File tree Expand file tree Collapse file tree 1 file changed +0
-7
lines changed
Expand file tree Collapse file tree 1 file changed +0
-7
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ composer require tailflow/enum
2121Here is how enums are defined:
2222
2323``` php
24- <?php
25-
2624use Tailflow\Enum\Enum;
2725
2826class Status extends Enum
@@ -36,8 +34,6 @@ class Status extends Enum
3634This is how they are used:
3735
3836``` php
39- <?php
40-
4137$class->setStatus(Status::Inactive);
4238```
4339
@@ -46,16 +42,13 @@ $class->setStatus(Status::Inactive);
4642By default, enum labels are derived from the constant names. To get enum label, you can use ` ::getLabel ` method on enum class:
4743
4844``` php
49- <?php
50-
5145// $label will be equal to "OnHold" - the name of the constant
5246$label = Status::getLabel(Status::OnHold);
5347```
5448
5549Optionally, you can provide a different label for any given enum value:
5650
5751``` php
58- <?php
5952use Tailflow\Enum\Enum;
6053
6154class Status extends Enum
You can’t perform that action at this time.
0 commit comments