Convert type to PdoParamType

@param string $type Type

@return intger The PDO Param Type
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;
        }
    }
1099161
private function getPdoType($value): int
    {
        if (is_int($value) === true) {
            $type = PDO::PARAM_INT;
        } elseif (is_bool($value)) {
            $type = PDO::PARAM_BOOL;
        } elseif ($value instanceof DateTimeInterface) {
            $type = PDO::PARAM_STR;
        } else {
            assert(
                $value !== null,
                'It seems you are trying to use `null` with =, >, <, or etc operator. ' .
                'Use `is null` or `not null` instead.'
            );
            assert(is_string($value), "Only strings, booleans and integers are supported.");
            $type = PDO::PARAM_STR;
        }

        return $type;
    }
92288
protected function parseParameterType($value): int
    {

        if ($value === null) {
            return PDO::PARAM_NULL;
        }

        if (\is_int($value) === true || \is_bool($value) === true) {
            return PDO::PARAM_INT;
        }

        return PDO::PARAM_STR;
    }
614152
public function setType($type) {

        $this->checkInArray($type, GDAXConstants::$orderTypeValues);
        $this->type = $type;
        return $this;

    }
790055
private function getDimensions($type)
    {
        if ($this->is2D($type)) {
            return null;
        }

        if ($type & (self::WKB_FLAG_SRID | self::WKB_FLAG_M | self::WKB_FLAG_Z)) {
            return $type & (self::WKB_FLAG_M | self::WKB_FLAG_Z);
        }

        return $type - ($type % 1000);
    }
105260
protected function getBuilderForType(string $type): Builder
    {
        if (null === $this->builder_factory) {
            throw UnresolvableBuilderException::forType($type);
        }

        return $this->builder_factory->buildForType($type);
    }
850729
public function getParamFormat(string $type): string
    {
        return ltrim(($this->containerPrefix.'.entity.'.$this->entityName.'.'.$type), '.');
    }
744029
private function resolveDatabaseType($type)
    {
        foreach ($this->getDatabases() as $database) {
            if ($database->type === $type) {
                return $database;
            }
        }
        throw new \DomainException(sprintf('Unknown database type (%s). Please use mysqli, pgsql or mariadb.', $type));
    }
40473
public function type($type)
    {
        $fail = false;

        $value = $this->value();

        if ($value === null) {
            return $this;
        }

        switch (strtolower($type)) {
            case 'bool':
            case 'boolean':
                if ($fail = !is_bool($value)) {
                    $message = sprintf('%s accepts only boolean values as argument %d.', $this->getCommandName(),
                        $this->key + 1);
                }
                break;

            case 'int':
            case 'integer':
                if ($fail = !is_int($value)) {
                    $message = sprintf('%s accepts only integer values as argument %d.', $this->getCommandName(),
                        $this->key + 1);
                }
                break;

            case 'num':
            case 'numeric':
                $fail = !is_numeric($value);
                $message = sprintf('%s accepts only numeric values as argument %d.', $this->getCommandName(),
                    $this->key + 1);
                break;

            case 'str':
            case 'string':
                if ($fail = !is_string($value)) {
                    $message = sprintf('%s accepts only string values as argument %d.', $this->getCommandName(),
                        $this->key + 1);
                }
                break;

            case 'array':
                if ($fail = !is_array($value)) {
                    $message = sprintf('%s accepts only array as argument %d.', $this->getCommandName(),
                        $this->key + 1);
                }
                break;

            case 'closure':
                if ($fail = !$value instanceof \Closure) {
                    $message = sprintf('%s accepts only Closure as argument %d.', $this->getCommandName(),
                        $this->key + 1);
                }
                break;

            case 'digit':
                if ($fail = !$this->isDigit($value)) {
                    $message = sprintf('%s accepts only integer values as argument %d.', $this->getCommandName(),
                        $this->key + 1);
                }
                break;
        }

        if ($fail) {
            $message = $message ?? sprintf('Missing argument for %d.', $this->key);

            throw new \Hail\Image\Exception\InvalidArgumentException($message);
        }

        return $this;
    }
579088
public function setType($type)
    {
        if ($type === null) {
            $this->$type = $type;
        } else {
            $iconSetType = new IconSetTypeEnum($type);
            $this->type = $iconSetType->getValue();
        }

        return $this;
    }
1097617
private static function processType(Type $type)
    {
        // TODO type-resolver v1 compat
        // if ($type instanceof AbstractList) {
        if ($type instanceof Array_) {
            return self::flatmap(function ($t) {
                return self::processType($t);
            }, [$type->getKeyType(), $type->getValueType()]);
        }

        if ($type instanceof Compound) {
            return self::flatmap(function ($t) {
                return self::processType($t);
            }, iterator_to_array($type));
        }

        if ($type instanceof Nullable) {
            return self::processType($type->getActualType());
        }

        if ($type instanceof Object_) {
            if (($fq = $type->getFqsen()) !== null) {
                return [ltrim((string) $fq, '\\')];
            }
        }

        return [];
    }
464500
public static function dataTypeToEavColumn($type)
    {
        switch ($type) {
            case Property::DATA_TYPE_FLOAT:
                return 'value_float';
                break;

            case Property::DATA_TYPE_BOOLEAN:
            case Property::DATA_TYPE_INTEGER:
                return 'value_integer';
                break;

            case Property::DATA_TYPE_TEXT:
            case Property::DATA_TYPE_PACKED_JSON:
            case Property::DATA_TYPE_INVARIANT_STRING:
                return 'value_text';
                break;

            case Property::DATA_TYPE_STRING:
            default:
                return 'value_string';
                break;
        }
    }
906538
public function setType($type)
    {
        if (is_string($type)) {
            if ('all' == strtolower($type)) {
                $this->type = array_keys($this->cards);
            } else {
                $this->type = explode(',', $type);
            }
        } elseif (is_array($type)) {
            $this->type = $type;
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type array or string, "%s" given',
                is_object($type) ? get_class($type) : gettype($type)
            ));
        }

        return $this;
    }
664522
public function getType(string $type): Type
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        $instance = $this->createType($type);
        $this->addType($instance);
        $this->types[$type] = $instance;

        return $instance;
    }
1073689
public function type($type = null)
    {
        if (is_null($type)) {
            return $this->type;
        }

        $this->type = $type;

        return $this;
    }
932584
public function mapResponseToType($type) {

        if (!empty($this->rawData)) {

            foreach ($this->rawData as $dataSet) {

                if (!is_array($dataSet)) {
                    $this->data = (new $type())->initFromArray($this->rawData);
                    break;
                }

                $this->data[] = (new $type())->initFromArray($dataSet);

            }

        }

        if (!empty($this->rawData['before'])) {
            $this->data->setBefore($this->rawData['before']);
        }

        if (!empty($this->rawData['after'])) {
            $this->data->setAfter($this->rawData['before']);
        }

        if (!empty($this->rawData['message'])) {
            $this->data->setMessage($this->rawData['message']);
        }

        return $this;

    }
1353444
public function getFieldBindType($type)
    {
        if (0 === strpos($type, 'set') || 0 === strpos($type, 'enum')) {
            $bind = PDO::PARAM_STR;
        } elseif (preg_match('/(double|float|decimal|real|numeric)/is', $type)) {
            $bind = self::PARAM_FLOAT;
        } elseif (preg_match('/(int|serial|bit)/is', $type)) {
            $bind = PDO::PARAM_INT;
        } elseif (preg_match('/bool/is', $type)) {
            $bind = PDO::PARAM_BOOL;
        } else {
            $bind = PDO::PARAM_STR;
        }

        return $bind;
    }