@param $type

@return bool|string
16386
public static function getFinancialRequestClassForTrxType($type)
    {
        $map = [
            self::ABNIDEAL                => 'Alternatives\ABNiDEAL',
            self::EARTHPORT               => 'Alternatives\Earthport',
            self::INPAY                   => 'Alternatives\INPay',
            self::P24                     => 'Alternatives\P24',
            self::PAYPAL_EXPRESS          => 'Alternatives\PaypalExpress',
            self::POLI                    => 'Alternatives\POLi',
            self::PPRO                    => 'Alternatives\PPRO',
            self::SOFORT                  => 'Alternatives\Sofort',
            self::TRUSTLY_SALE            => 'Alternatives\Trustly\Sale',
            self::TRUSTLY_WITHDRAWAL      => 'Alternatives\Trustly\Withdrawal',
            self::KLARNA_AUTHORIZE        => 'Alternatives\Klarna\Authorize',
            self::INIT_RECURRING_SALE     => 'Cards\Recurring\InitRecurringSale',
            self::INIT_RECURRING_SALE_3D  => 'Cards\Recurring\InitRecurringSale3D',
            self::RECURRING_SALE          => 'Cards\Recurring\RecurringSale',
            self::ARGENCARD               => 'Cards\Argencard',
            self::AURA                    => 'Cards\Aura',
            self::AUTHORIZE               => 'Cards\Authorize',
            self::AUTHORIZE_3D            => 'Cards\Authorize3D',
            self::CABAL                   => 'Cards\Cabal',
            self::CENCOSUD                => 'Cards\Cencosud',
            self::CREDIT                  => 'Cards\Credit',
            self::ELO                     => 'Cards\Elo',
            self::HIPERCARD               => 'Cards\Hipercard',
            self::NARANJA                 => 'Cards\Naranja',
            self::NATIVA                  => 'Cards\Nativa',
            self::PAYOUT                  => 'Cards\Payout',
            self::SALE                    => 'Cards\Sale',
            self::SALE_3D                 => 'Cards\Sale3D',
            self::TARJETA_SHOPPING        => 'Cards\TarjetaShopping',
            self::BALOTO                  => 'CashPayments\Baloto',
            self::BANAMEX                 => 'CashPayments\Banamex',
            self::BANCO_DE_OCCIDENTE      => 'CashPayments\BancoDeOccidente',
            self::BOLETO                  => 'CashPayments\Boleto',
            self::CARULLA                 => 'CashPayments\Carulla',
            self::EFECTY                  => 'CashPayments\Efecty',
            self::EMPRESE_DE_ENERGIA      => 'CashPayments\EmpreseDeEnergia',
            self::OXXO                    => 'CashPayments\Oxxo',
            self::PAGO_FACIL              => 'CashPayments\PagoFacil',
            self::REDPAGOS                => 'CashPayments\Redpagos',
            self::SANTANDER_CASH          => 'CashPayments\SantanderCash',
            self::SURTIMAX                => 'CashPayments\Surtimax',
            self::BITPAY_PAYOUT           => 'Crypto\BitPay\Payout',
            self::BITPAY_REFUND           => 'Crypto\BitPay\Refund',
            self::BITPAY_SALE             => 'Crypto\BitPay\Sale',
            self::TCS                     => 'GiftCards\Tcs',
            self::FASHIONCHEQUE           => 'GiftCards\Fashioncheque',
            self::INTERSOLVE              => 'GiftCards\Intersolve',
            self::ALIPAY                  => 'OnlineBankingPayments\Alipay',
            self::ASTROPAY_DIRECT         => 'OnlineBankingPayments\AstropayDirect',
            self::BANCO_DO_BRASIL         => 'OnlineBankingPayments\BancoDoBrasil',
            self::BANCOMER                => 'OnlineBankingPayments\Bancomer',
            self::BRADESCO                => 'OnlineBankingPayments\Bradesco',
            self::CITADEL_PAYIN           => 'OnlineBankingPayments\Citadel\Payin',
            self::CITADEL_PAYOUT          => 'OnlineBankingPayments\Citadel\Payout',
            self::ENTERCASH               => 'OnlineBankingPayments\Entercash',
            self::IDEBIT_PAYIN            => 'OnlineBankingPayments\iDebit\Payin',
            self::IDEBIT_PAYOUT           => 'OnlineBankingPayments\iDebit\Payout',
            self::INSTA_DEBIT_PAYIN       => 'OnlineBankingPayments\InstaDebit\PayIn',
            self::INSTA_DEBIT_PAYOUT      => 'OnlineBankingPayments\InstaDebit\Payout',
            self::INSTANT_TRANSFER        => 'OnlineBankingPayments\InstantTransfer',
            self::ITAU                    => 'OnlineBankingPayments\Itau',
            self::MULTIBANCO              => 'OnlineBankingPayments\Multibanco',
            self::ONLINE_BANKING_PAYIN    => 'OnlineBankingPayments\OnlineBanking\Payin',
            self::ONLINE_BANKING_PAYOUT   => 'OnlineBankingPayments\OnlineBanking\Payout',
            self::PAYU                    => 'OnlineBankingPayments\PayU',
            self::PSE                     => 'OnlineBankingPayments\Pse',
            self::RAPIPAGO                => 'OnlineBankingPayments\Rapipago',
            self::SAFETYPAY               => 'OnlineBankingPayments\SafetyPay',
            self::SANTANDER               => 'OnlineBankingPayments\Santander',
            self::WECHAT                  => 'OnlineBankingPayments\WeChat',
            self::PAYBYVOUCHER_YEEPAY     => 'PayByVouchers\oBeP',
            self::PAYBYVOUCHER_SALE       => 'PayByVouchers\Sale',
            self::SCT_PAYOUT              => 'SCT\Payout',
            self::SDD_SALE                => 'SDD\Sale',
            self::SDD_INIT_RECURRING_SALE => 'SDD\Recurring\InitRecurringSale',
            self::SDD_RECURRING_SALE      => 'SDD\Recurring\RecurringSale',
            self::SDD_REFUND              => 'SDD\Refund',
            self::SDD_SALE                => 'SDD\Sale',
            self::ASTROPAY_CARD           => 'Vouchers\AstropayCard',
            self::CASHU                   => 'Vouchers\CashU',
            self::NEOSURF                 => 'Vouchers\Neosurf',
            self::PAYSAFECARD             => 'Vouchers\Paysafecard',
            self::EZEEWALLET              => 'Wallets\eZeeWallet',
            self::NETELLER                => 'Wallets\Neteller',
            self::WEBMONEY                => 'Wallets\WebMoney',
            self::ZIMPLER                 => 'Wallets\Zimpler',
        ];

        return isset($map[$type]) ? 'Financial\\' . $map[$type] : false;
    }
1167186
public static function getPhpType($type)
    {
        switch ($type) {
            case self::TYPE_DOUBLE:
            case self::TYPE_FLOAT:
                return 'float';
            case self::TYPE_INT64:
            case self::TYPE_UINT64:
            case self::TYPE_INT32:
            case self::TYPE_FIXED64:
            case self::TYPE_FIXED32:
            case self::TYPE_UINT32:
            case self::TYPE_SFIXED32:
            case self::TYPE_SFIXED64:
            case self::TYPE_SINT32:
            case self::TYPE_SINT64:
                return 'int';
            case self::TYPE_BOOL:
                return 'bool';
            case self::TYPE_STRING:
                return 'string';
            case self::TYPE_BYTES:
                return '\Protobuf\Stream';
            default:
                return null;
        }
    }
140013
public function getFormat($type)
    {
        if (!$this->typeIsAvailable($type)) {
            return false;
        }

        if (isset($this->formats[$type])) {
            return $this->formats[$type];
        }

        if (!is_null($this->getDefaultFormat())) {
            return $this->getDefaultFormat();
        }

        return false;
    }
1355371
public function find($type)
    {
        if (!isset($this->instances[$type])) {
            trigger_error(sprintf("type '%s' is unregistered", $type), E_USER_WARNING);

            return $this->nullInstance;
        }

        $instance = $this->instances[$type];

        if ($instance instanceof TypeInterface) {
            return $instance;
        }

        if (is_string($instance) && class_exists($this->instances[$type])) {
            return $this->instances[$type] = new $instance();
        }

        trigger_error(sprintf("class '%s' does not exists", (string)$instance), E_USER_WARNING);
        unset($this->instances[$type]);

        return $this->nullInstance;
    }
361206
public function getColorForType($type)
    {
        // if we don't have a type return default color
        if (!isset($this->colors[$type])) {
            return Colours::DEFAULT_;
        }

        return $this->colors[$type];
    }
260648
public function getClassForType(string $type):?string
    {
        if (isset($this->typeMap[$type])) {
            return $this->typeMap[$type];
        }

        return null;
    }
91273
public static function getTypeName($type)
    {
        return isset(self::$names[$type])
            ? self::$names[$type]
            : null;
    }
326707
public function type($type = null)
    {
        if (!func_num_args()) {
            return $this->_type;
        }
        $this->_type = $type;
        return $this;
    }
739640
public function is($type = null)
    {
        if ($type === null) {
            return $this->is;
        } else {
            return $type == $this->is;
        }
    }
1194423
public function type($type = null) {
		if ($type === false) {
			unset($this->headers['Content-Type']);
			$this->_type = false;
			return;
		}
		$media = $this->_classes['media'];

		if (!$type && $this->_type) {
			return $this->_type;
		}
		$headers = $this->headers + ['Content-Type' => null];
		$type = $type ?: $headers['Content-Type'];

		if (!$type) {
			return;
		}
		$header = $type;

		if (!$data = $media::type($type)) {
			$this->headers('Content-Type', $type);
			return ($this->_type = $type);
		}
		if (is_string($data)) {
			$type = $data;
		} elseif (!empty($data['content'])) {
			$header = is_string($data['content']) ? $data['content'] : reset($data['content']);
		}
		$this->headers('Content-Type', $header);
		return ($this->_type = $type);
	}
108272
protected function checkType($type)
    {
        // If no types to check are defined return true
        if (empty($this->types)) {
            return true;
        }

        // Check input type
        $expression = implode('|', $this->types);
        $valid = preg_match('/^(' . $expression . ')$/', $type);

        return $valid === 1;
    }
1131638
public function hasType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        return \in_array($type, $this->_types);
    }
250460
private function getTypeSuffix($type)
    {
        self::$TYP_MAPPING = array_merge(self::$TYP_COMPLEX_MAPPING, self::$TYP_SIMPLE_MAPPING);

        if ($type == '') {
            return '';
        }

        if (!isset(self::$TYP_MAPPING[$this->type])) {
            return '';
        }

        return self::$TYP_MAPPING[$this->type];
    }
253968
protected function calculateSimpleType($type) {
    $pos = strrpos($type, '.');
    if ($pos !== false) {
      return substr($type, $pos+1);
    }
    return $type;
  }
729386
protected function _getInheritanceTypeString($type)
    {
        switch ($type) {
            case ClassMetadataInfo::INHERITANCE_TYPE_NONE:
                return 'NONE';

            case ClassMetadataInfo::INHERITANCE_TYPE_JOINED:
                return 'JOINED';

            case ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE:
                return 'SINGLE_TABLE';

            case ClassMetadataInfo::INHERITANCE_TYPE_TABLE_PER_CLASS:
                return 'PER_CLASS';
        }
    }
413949
protected function getType($type)
    {
        if (isset($this->typeAlias[$type])) {
            return $this->typeAlias[$type];
        }

        return $type;
    }
84421
private function getLongTypeFromType(string $type): string
    {
        $reflection = new \ReflectionObject($this);
        foreach ($reflection->getConstants() as $const => $value) {
            if (0 === strpos($const, 'TYPE_')) {
                if ($type === $value) {
                    return strtolower(substr($const, 5));
                }
            }
        }

        return 'info';
    }