File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ abstract class Enum
2929 *
3030 * @var array
3131 */
32- private static $ cache = array ();
32+ protected static $ cache = array ();
3333
3434 /**
3535 * Creates a new value of some type
@@ -62,7 +62,7 @@ public function getValue()
6262 */
6363 public function getKey ()
6464 {
65- return self ::search ($ this ->value );
65+ return static ::search ($ this ->value );
6666 }
6767
6868 /**
@@ -107,12 +107,12 @@ public static function values()
107107 public static function toArray ()
108108 {
109109 $ class = get_called_class ();
110- if (!array_key_exists ($ class , self ::$ cache )) {
110+ if (!array_key_exists ($ class , static ::$ cache )) {
111111 $ reflection = new \ReflectionClass ($ class );
112- self ::$ cache [$ class ] = $ reflection ->getConstants ();
112+ static ::$ cache [$ class ] = $ reflection ->getConstants ();
113113 }
114114
115- return self ::$ cache [$ class ];
115+ return static ::$ cache [$ class ];
116116 }
117117
118118 /**
You can’t perform that action at this time.
0 commit comments