We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98d33b1 commit 132d7f3Copy full SHA for 132d7f3
core/Base/Enum.class.php
@@ -29,8 +29,7 @@ abstract class Enum extends NamedObject
29
*/
30
public static function create($id)
31
{
32
- $className = get_called_class();
33
- return new $className($id);
+ return new static($id);
34
}
35
36
public function __construct($id)
@@ -45,11 +44,9 @@ public function __construct($id)
45
44
46
protected function setInternalId($id)
47
48
- $names = static::$names;
49
-
50
- if (isset($names[$id])) {
+ if (isset(static::$names[$id])) {
51
$this->id = $id;
52
- $this->name = $names[$id];
+ $this->name = static::$names[$id];
53
} else
54
throw new MissingElementException(
55
'knows nothing about such id == '.$id
0 commit comments