gw.CRCStatus */ class CRCStatus { /** * No CRC. * * Generated from protobuf enum NO_CRC = 0; */ const NO_CRC = 0; /** * Bad CRC. * * Generated from protobuf enum BAD_CRC = 1; */ const BAD_CRC = 1; /** * CRC OK. * * Generated from protobuf enum CRC_OK = 2; */ const CRC_OK = 2; private static $valueToName = [ self::NO_CRC => 'NO_CRC', self::BAD_CRC => 'BAD_CRC', self::CRC_OK => 'CRC_OK', ]; public static function name($value) { if (!isset(self::$valueToName[$value])) { throw new UnexpectedValueException(sprintf( 'Enum %s has no name defined for value %s', __CLASS__, $value)); } return self::$valueToName[$value]; } public static function value($name) { $const = __CLASS__ . '::' . strtoupper($name); if (!defined($const)) { throw new UnexpectedValueException(sprintf( 'Enum %s has no value defined for name %s', __CLASS__, $name)); } return constant($const); } }