Determines the PDO::PARAM_* type for a given PHP type string
@param string $phpType Type of object in PHP
@return integer PDO Parameter constant value
323745
public function getPDOParamType($phpType)
    {
        switch ($phpType) {
            case 'boolean':
                return PDO::PARAM_BOOL;
            case 'NULL':
                return PDO::PARAM_NULL;
            case 'integer':
                return PDO::PARAM_INT;
            case 'object': // Allowed if the object or resource has a __toString method
            case 'resource':
            case 'float': // Not actually returnable from get_type
            case 'double':
            case 'string':
                return PDO::PARAM_STR;
            case 'blob':
                return PDO::PARAM_LOB;
            case 'array':
            case 'unknown type':
            default:
                throw new InvalidArgumentException("Cannot bind parameter as it is an unsupported type ($phpType)");
        }
    }
279665
public function getPdoType($type, $value)
    {
        if (null === $value) {
            $type = \PDO::PARAM_NULL;
        } else {
            switch ($type) {
                case AbstractEntity::TYPE_BOOL:
                    $type = \PDO::PARAM_BOOL;
                    break;
                case AbstractEntity::TYPE_INT:
                    $type = \PDO::PARAM_INT;
                    break;
                default:
                    $type = \PDO::PARAM_STR;
            }
        }

        return $type;
    }
800589
public static function getType($parameter)
    {
        if (is_bool($parameter)) {
            return \PDO::PARAM_BOOL;
        } elseif ($parameter === null) {
            return \PDO::PARAM_NULL;
        } elseif (is_int($parameter)) {
            return \PDO::PARAM_INT;
        } else {
            return \PDO::PARAM_STR;
        }
    }
833116
public function type($mapping_type) {
		$args = func_get_args();
		$mapping_type = array_shift($args);
	
		//check if mapping arguments are defined
		if (empty($args))
			return $this->merge(['map.type' => $mapping_type]);
	
		return $this->merge(['map.type' => $mapping_type, 'map.params' => $args]);
	}
125459
public static function getResultTypeName( $resultType )
	{
		// Maybe this should be: XmlTypeCode::$codeToTypeMap[ $typeCode ];
		$oClass = new \ReflectionClass( __CLASS__ );
		foreach ( $oClass->getConstants() as $key => $value )
		{
			if ( $value == $resultType ) return $key;
		}

		return "???";
	}
15428
protected function typeToPDOParamType($type)
    {
        switch ($type) {
        case "boolean":
            return PDO::PARAM_BOOL;
        case "integer":
            return PDO::PARAM_STR;
        case "NULL":
            return PDO::PARAM_NULL;
        case "resource":
            return PDO::PARAM_LOB;
        case "double":
        case "string":
        default:
            return PDO::PARAM_STR;
        }
    }
799740
public function assign($value, int $type = PDO::PARAM_STR)
    {
        $key = $this->getNextKey();
        $this->params[$key] = $value;
        $this->param_types[$key] = $type;
        return $key;
    }
976292
public function setParamType($param_name, $php_type, $new_type, $phpdoc_type, $is_php_compatible)
    {
        $new_type = str_replace(['<mixed, mixed>', '<array-key, mixed>', '<empty, empty>'], '', $new_type);

        if ($php_type) {
            $this->new_php_param_types[$param_name] = $php_type;
        }
        $this->new_phpdoc_param_types[$param_name] = $phpdoc_type;
        $this->new_psalm_param_types[$param_name] = $new_type;
        $this->param_type_is_php_compatible[$param_name] = $is_php_compatible;
    }
142748
public function getPhpType()
    {
        if (isset(self::$_phpTypesByProtobufType[$this->getType()])) {
            return self::$_phpTypesByProtobufType[$this->getType()];
        } else {
            return null;
        }
    }
533653
public function getPDOParamType($type)
	{
		switch($type)
		{
			case 'b':
				return PDO::PARAM_BOOL;
			case 'd':
				return PDO::PARAM_INT;
			case 'l':
				return PDO::PARAM_LOB;
			default:
				return PDO::PARAM_STR;
		}
	}
333065
public static function castFromString($type, $value, $php_type)
    {
        //Here should maybe handle locale specific tz overrides in the future.
        $timezone = null;

        switch ($type) {

            case self::PROPERTY_TYPE_INT:
                return (int) $value;

            case self::PROPERTY_TYPE_FLOAT:
                return (float) $value;

            case self::PROPERTY_TYPE_BOOLEAN:
                return in_array(strtolower($value), ['true', '1', 'yes'], true);

            /** @noinspection PhpMissingBreakStatementInspection */
            case self::PROPERTY_TYPE_TIMESTAMP:
                $timezone = new \DateTimeZone('UTC');

                // no break
            case self::PROPERTY_TYPE_DATE:
                if (preg_match('/Date\\((?<timestamp>[0-9\\+\\.]+)\\)/', $value, $matches)) { //to catch stupid .net date serialisation
                    $value = $matches['timestamp'];
                }

                return new \DateTime($value, $timezone);

            case self::PROPERTY_TYPE_OBJECT:
                $php_type = sprintf('\\XeroPHP\\Models\\%s', $php_type);
                /** @var self $instance */
                $instance = new $php_type();
                $instance->fromStringArray($value);

                return $instance;

            default:
                if (is_scalar($value)) {
                    return (string) $value;
                }

                return (object) $value;
        }
    }
473363
public function setType($type)
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex());
            $type = $type->getName();
        }

        return $this->setParam('_type', $type);
    }
1006401
public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = "            ", $phpType = null)
    {
        return sprintf(
            "
%s%s = %s%s->lastInsertId(%s);",
            $tab,
            $columnValueMutator,
            $connectionVariableName,
            $phpType ? '('.$phpType.') ' : '',
            $sequenceName ? ("'" . $sequenceName . "'") : ''
        );
    }
1315506
protected function extractType($dbType)
	{
		if(preg_match('/(FLO|REA|DOU|NUM|DEC)/',$dbType))
			$this->type='double';
		// The following "bool" and 'boolean" are for future compatibility.
		// As of CUBRID 9.0, they are not supported.
		elseif(strpos($dbType,'BOOL')!==false)
			$this->type='boolean';
		elseif(preg_match('/(INT|BIT|SMA|SHO|NUM)/',$dbType))
			$this->type='integer';
		else
			$this->type='string';
	}
740937
public final function detectFetchType($fetchType): int
    {
        switch (gettype($fetchType)) {
            case 'NULL':
                return ResultInterface::AS_OBJECT;
            case 'integer':
                if (in_array($fetchType, [ResultInterface::AS_OBJECT, ResultInterface::AS_ARRAY_ASC,
                    ResultInterface::AS_ARRAY_NUM, ResultInterface::AS_ARRAY_ASCNUM])) {
                    return $fetchType;
                }
                break;
            case 'string':
                // shorthands
                if ($fetchType == 'array') return ResultInterface::AS_ARRAY_ASC;
                if ($fetchType == 'object') return ResultInterface::AS_OBJECT;

                //  object, array_asc etc.
                $fetchTypeConst = 'Oppa\Query\Result\ResultInterface::AS_'. strtoupper($fetchType);
                if (defined($fetchTypeConst)) {
                    return constant($fetchTypeConst);
                }

                // user classes
                if (class_exists($fetchType)) {
                    $this->setFetchObject($fetchType);

                    return ResultInterface::AS_OBJECT;
                }
                break;
        }

        throw new InvalidValueException("Given '{$fetchType}' fetch type is not implemented!");
    }
328381
public function getType(): string
    {
        $type = $this->parameter->type->__toString();
        $strType = Type::toRootNamespace($type);
        if ($strType !== 'mixed' && $strType !== 'resource' && $this->phpStanFunction !== null) {
            $phpStanParameter = $this->phpStanFunction->getParameter($this->getParameter());
            if ($phpStanParameter) {
                // Let's make the parameter nullable if it is by reference and is used only for writing.
                if ($phpStanParameter->isWriteOnly()) {
                    $strType = '?'.$strType;
                }
            }
        }
        return $strType;
    }
331464
static function getArrayType($type){
        self::isArray($type) or \PhpBoot\abort(new \InvalidArgumentException("$type is not array"));
        if($type == 'array') {
            return 'mixed';
        }else{
            return substr($type,0,-2);
        }
    }