/** * @inheritdoc */ public static function addEnumItem(Enum $instance) { if (!isset(self::$instancesByValues[static::class])) { self::$instancesByValues[static::class] = []; } if ($instance instanceof BaseEnum) { self::$instancesByValues[static::class][$instance->getValue()] = $instance; } parent::addEnumItem($instance); }