<?php

namespace app\enum\gateway\message;

use app\entity\gateway\script\BaseScript;

/**
 * 网关/消息/Script类型枚举
 */
enum ScriptEnum: string
{
    case ElNotification = 'ElNotification';
    case Swal = 'Swal';

    public static function create(BaseScript $class): array
    {
        $event = basename(str_replace('\\', '/', get_class($class)));
        $data = $class->toArray();
        return ['script', $event, $data];
    }
}