Skip to content

Commit 9951a06

Browse files
committed
Cache from private to protected
1 parent cc43c4a commit 9951a06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Enum.php

+5-5
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)