File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,25 @@ final private function __construct($value)
52
52
$ this ->value = $ constants [$ const ];
53
53
}
54
54
55
+ /**
56
+ * Get the selected value
57
+ * @return string
58
+ * @see getValue()
59
+ */
60
+ final public function __toString ()
61
+ {
62
+ return (string ) $ this ->value ;
63
+ }
64
+
65
+ /**
66
+ * @throws LogicException Enums are not cloneable
67
+ * because instances are implemented as singletons
68
+ */
69
+ final private function __clone ()
70
+ {
71
+ throw new LogicException ('Enums are not cloneable ' );
72
+ }
73
+
55
74
/**
56
75
* Get the current selected value
57
76
* @return mixed
@@ -94,16 +113,6 @@ final public function getOrdinal()
94
113
return $ ordinal ;
95
114
}
96
115
97
- /**
98
- * Get the current selected constant name
99
- * @return string
100
- * @see getName()
101
- */
102
- final public function __toString ()
103
- {
104
- return (string ) $ this ->value ;
105
- }
106
-
107
116
/**
108
117
* Get an enum of the given value
109
118
*
You can’t perform that action at this time.
0 commit comments