File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -45,19 +45,19 @@ It's an abstract class that needs to be extended to use it.
45
45
const STR = 'string';
46
46
const FLOAT = 0.123;
47
47
}
48
-
48
+
49
49
// different ways to instantiate an enumerator
50
50
$status = UserStatus::get(UserStatus::ACTIVE);
51
51
$status = UserStatus::ACTIVE();
52
52
$status = UserStatus::getByName('ACTIVE');
53
53
$status = UserStatus::getByOrdinal(1);
54
-
54
+
55
55
// available methods to get the selected entry
56
56
$status->getValue(); // returns the selected constant value
57
57
$status->getName(); // returns the selected constant name
58
58
$status->getOrdinal(); // returns the ordinal number of the selected constant
59
59
(string) $status; // returns the selected constant name
60
-
60
+
61
61
// same enumerators (of the same enumeration class) holds the same instance
62
62
UserStatus::get(UserStatus::ACTIVE) === UserStatus::ACTIVE()
63
63
UserStatus::get(UserStatus::DELETED) != UserStatus::INACTIVE()
You can’t perform that action at this time.
0 commit comments