<?php

namespace Modules\Manage\Enmus;

use Catch\Enums\Enum;


enum MiniprogramType: int implements Enum
{
    case WEIXIN = 1; // 全部数据
    case BYTECODE = 2; // 自定义数据


    public function value(): int
    {
        return match ($this) {
            self::WEIXIN => 1,
            self::BYTECODE => 2
        };
    }

    public function name(): string
    {
        return match ($this) {
            self::WEIXIN => '微信小程序',
            self::BYTECODE => '字节小程序',
        };
    }

    /**
     * assert value
     *
     * @param int $value
     * @return bool
     */
    public function assert(int $value): bool
    {
       return $this->value === $value;
    }
}
