private function IANA2PHP(int $type): int
    {
        $constantName = 'DNS_'.RecordTypeEnum::getName($type);
        if (!defined($constantName)) {
            throw new UnsupportedTypeException(sprintf('Record type "%d" is not a supported type.', $type));
        }

        $phpType = constant($constantName);

        if (!is_int($phpType)) {
            throw new \InvalidArgumentException(sprintf('Constant "%s" is not an integer.', $constantName));
        }

        return $phpType;
    }
private function IANA2PHP(int $type): int
    {
        $constantName = 'DNS_'.RecordTypeEnum::getName($type);
        if (!defined($constantName)) {
            throw new UnsupportedTypeException(sprintf('Record type "%d" is not a supported type.', $type));
        }

        $phpType = constant($constantName);

        if (!is_int($phpType)) {
            throw new \InvalidArgumentException(sprintf('Constant "%s" is not an integer.', $constantName));
        }

        return $phpType;
    }
private function IANA2PHP ( int $ type ) : int { $ constantName = 'DNS_' . RecordTypeEnum :: getName ( $ type ) ; if ( ! defined ( $ constantName ) ) { throw new UnsupportedTypeException ( sprintf ( 'Record type "%d" is not a supported type.' , $ type ) ) ; } $ phpType = constant ( $ constantName ) ; if ( ! is_int ( $ phpType ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Constant "%s" is not an integer.' , $ constantName ) ) ; } return $ phpType ; }
Maps an IANA Rdata type to the built-in PHP DNS constant.

@example $this->IANA_to_PHP(5) //Returns DNS_CNAME int(16)

@param int $type the IANA RTYPE

@return int the built-in PHP DNS_<type> constant or `false` if the type is not defined

@throws UnsupportedTypeException|\InvalidArgumentException
Maps an IANA Rdata type to the built - in PHP DNS constant .