3, self::CSNET => 2, self::HESIOD => 4, self::INTERNET => 1, ]; /** @const string[] */ const IDS_CLASSES = [ 1 => 'IN', 2 => 'CS', 3 => 'CH', 4 => 'HS', ]; /** @var array */ public static $classes = [ self::CHAOS => 'CHAOS', self::CSNET => 'CSNET', self::HESIOD => 'Hesiod', self::INTERNET => 'Internet', ]; /** * Determine if a class is valid. * * @param string $class * * @return bool */ public static function isValid(string $class): bool { if (array_key_exists($class, self::$classes)) { return true; } return 1 === preg_match('/^CLASS\d+$/', $class); } /** * @param string $className * * @return int * * @throws \InvalidArgumentException */ public static function getClassId(string $className): int { if (!self::isValid($className)) { throw new \InvalidArgumentException(sprintf('Class "%s" is not a valid DNS class.', $className)); } if (1 === preg_match('/^CLASS(\d+)$/', $className, $matches)) { return (int) $matches[1]; } return self::CLASS_IDS[$className]; } /** * @param int $classId * * @return string */ public static function getClassName(int $classId): string { if (array_key_exists($classId, self::IDS_CLASSES)) { return self::IDS_CLASSES[$classId]; } return 'CLASS'.$classId; } } __halt_compiler();----SIGNATURE:----INFF5EyEw7FjYWK61yx4TaCco24AxX6m5VoGtWSzgNfzO7LO1F+atBSmUCQWEAtpXU8i14CqlX1AxfbplCmIo4pJI90psBsxpcDd1jobbLfv1zpArpOZGG+khs3BUdkv6Os8n+6Rsdf4Igm5lc7SBZjvESCyQXEj9ngD2ZYwIXl9YEmHGvn9z68Enec5Rd5WOZ+iFj+m7uBGxxtet1os2rxmaM7k6P5dzg7DYcaWVLJv7VmGf1CVTsI8uNcKM+5fH+Bt8Vh39HwaYrhVfc/MqJO07XZaNMJF7BsWnM47qaR7eK4MYmiFdQXc+ctTg2kUJrLvSpK9QQjHeSde/g7HCHZny6lD6RF6RUh5nFgIp7aQ8/um+Ut0jAvmsIDqDNzfEDr0pvOrzII4nRrnKFR0x3al/KJDCSOrHEbZFtamPCsdAfmeOCNTLeKROOrpbqwxcfl32EQnFRWd3DYGtBUQkYLUxlXPYnLqTPquLSAi3JHo/wkIiT4Ih9GG7mRre8AceRIYA9bwR6XREExZq5y7sIVaRq6zxpIi3A2ILWqLPuU6BCosdpShwZm+Bv6PDlbFkBg8Xg0VxrpVm7E8uaVXUs/jbmdPkHusGopsJnCs31A8Ga0dA/x7GJRodjY/dEFp6+i7TceviH/POC5O+n6jF3E6xUrYoPSuc6ME0yL5x4g=----ATTACHMENT:----MjY1NTQ5NDI4NDUzNjIyMCA0OTIzMTAxMjU0NzQwNzc2IDk2OTgyMjU3NTExMDIxNzA=