@param string $value   Parameter value
@param string $type    Parameter type
@param array  $options Parameter options

@return mixed
163758
public function fromString($value, $type, array $options)
    {
        return $this->convert($value, $type, $options, $this->getFromStringCallbacks());
    }
1004631
public function bindValue($parameter = null, $value = null, $type = null)
    {
        parent::bindValue($parameter, $value, $type);
        
        return $this;
    }
1173812
protected function _getValueByType($value, $type)
	{
		if( !is_null($value) )
		{
			switch( $type )
			{
				case "id":
					if( array_contains( array('',null), $value, true ) )
					{
						$value = null;
					}
					else
					{
						$value = intval( $value );
					}
				break;
				case "bool":
				case "boolean":
					$value = (bool) $value;
				break;
				case "int":
					$value = (int) $value;
					break;
				case "float":
					$value = (float) $value;
				break;
				case "object":
				case "array":
					if(is_object($value) || !is_array($value))
					{
						$value = unserialize($value);
					}
				break;
				case "date":
					if($value == '0000-00-00' || $value == '')
					{
						$value = null;
					}
				break;
				case "time":
					if($value == '00:00:00' || $value == '')
					{
						$value = null;
					}
				break;
				case "datetime":
					if($value == '0000-00-00 00:00:00' || $value == '')
					{
						$value = null;
					}
				break;
				case "text":
				default:
					$value = (string) $value;
				break;
			}
		}

		return $value;
	}
476743
protected function renderWidget($type, $name, $value, $options)
    {
        unset($options['tabindex']);

        $model = $this->getModel();
        if ($model instanceof Model) {
            $widgetOptions = [
                'model'     => $model,
                'attribute' => $this->name,
                'value'     => $value,
                'options'   => [
                    'id'        => $this->normalize($name),
                    'name'      => $name,
                    'tabindex'  => self::TABINDEX,
                    'value'     => $value
                ]
            ];
        } else {
            $widgetOptions = [
                'name'      => $name,
                'value'     => $value,
                'options'   => [
                    'id'        => $this->normalize($name),
                    'name'      => $name,
                    'tabindex'  => self::TABINDEX,
                    'value'     => $value
                ]
            ];
        }

        $options = ArrayHelper::merge($options, $widgetOptions);

        return $type::widget($options);
    }
208542
private function getFinalValue(string $type, string $name, $value, bool $optionnal)
    {
        if ($optionnal && ($value === null || $value === '')) {
            return null;
        }

        if (strpos($type, '[]') !== false) {
            $return = [];
            foreach (is_array($value) ? $value : [$value] as $sKey => $currentValue) {
                $return[$sKey] = $this->getFinalValue(str_replace('[]', '', $type), $name, $currentValue, $optionnal);
            }

            return $return;
        }

        switch ($type) {
            case 'int':
                $value = filter_var($value, FILTER_VALIDATE_INT, ['flags' => FILTER_NULL_ON_FAILURE]);
                if (is_null($value)) {
                    throw new ResponseCode("Invalid integer parameters '$name' with value '$value'", 422);
                }

                break;

            case 'float':
                $value = filter_var($value, FILTER_VALIDATE_FLOAT, ['flags' => FILTER_NULL_ON_FAILURE]);
                if (is_null($value)) {
                    throw new ResponseCode("Invalid float parameters '$name' with value '$value'", 422);
                }

                break;

            case 'string':
                if (!is_string($value) || !$value) {
                    throw new ResponseCode("Invalid string parameters '$name' with value '$value'", 422);
                }
                break;

            case 'bool':
                if ($value !== '1' &&
                    $value !== 1 &&
                    $value !== '0' &&
                    $value !== 0 &&
                    $value !== 'true' &&
                    $value !== 'false'
                ) {
                    throw new ResponseCode("Invalid bool parameters '$name' with value '$value'", 422);
                }

                if ($value == '1') {
                    $value = true;
                } elseif ($value === 'true') {
                    $value = true;
                } elseif ($value == '0') {
                    $value = false;
                } elseif ($value === 'false') {
                    $value = false;
                }

                if (!is_bool($value)) {
                    throw new ResponseCode("Invalid bool parameters '$name' with value '$value'", 422);
                }
                break;

            case '\\Cawa\\SwaggerServer\\DateTime':
                $value = DateTime::createFromInput($value);
                break;

            case 'array':
                if (!is_array($value)) {
                    $jsonValue = @json_decode($value, true);

                    if ($jsonValue === false || !is_array($jsonValue)) {
                        throw new ResponseCode("Invalid array parameters '$name' with value '$value'", 422);
                    }

                    $value = $jsonValue;
                }
                break;

            case 'mixed':
                if (is_numeric($value)) {
                    $value = 0 + $value;
                }

                break;

            default:
                throw new \Exception('Invalid ' . $type . " parameters '$name' with value '$value'");
                break;
        }

        return $value;
    }
1097121
private function convert($value, $type, array $options, array $convertCallbacks)
    {
        if (null === $value) {
            return ParameterModel::TYPE_STRING === $type ? '' : null;
        }
        if (!isset($convertCallbacks[$type])) {
            return $value;
        }

        $callback = $convertCallbacks[$type];

        return is_string($callback) ? $callback($value) : $callback($value, $options);
    }
782670
protected function checkable($type, $name, $value, $checked, $options)
    {
        $checked = $this->getCheckedState($type, $name, $value, $checked);

        if ($checked) {
            $options['checked'] = 'checked';
        }

        return $this->input($type, $name, $value, $options);
    }
589021
public function bindValue(string $param, $value, int $type = null)
    {
        if (is_null($type)) {
            switch (true) {
                case is_int($value):
                    $type = \PDO::PARAM_INT;
                    break;
                case is_bool($value):
                    $type = \PDO::PARAM_BOOL;
                    break;
                case is_null($value):
                    $type = \PDO::PARAM_NULL;
                    break;
                default:
                    $type = \PDO::PARAM_STR;
            }
        }
        
        if (is_array($value)) {
            $value = implode(', ', $value);
        }
        
        $this->stmt->bindValue($param, $value, $type);
    }
1230667
public function param($param, $value, $type = null)
    {
        return $this->setParameter($param, $value, $type);
    }
543758
public function createParameter($value, $type = null)
    {
        if ($this->mode === self::MODE_POSITIONAL) {
            return $this->createPositionalParameter($value, $type);
        }

        return $this->createNamedParameter($value, $type);
    }
1298290
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        $validType = $this->validateType();
        $validGT = $this->validateGreaterThan();
        $validLT = $this->validateLowerThan();

        return $validType && $validGT && $validLT;
    }
24747
public function filter($value, array $options = [])
    {
        return is_string($value)
            ? filter_var(Str::lower(trim($value)), FILTER_SANITIZE_EMAIL)
            : $value;
    }
1019384
protected function convertToPHPValue($value, $type)
    {
        return Type::getType($type)->convertToPHPValue($value, $this->connection->getDatabasePlatform());
    }
564185
private function formatParameter($value, $type)
    {
        if (is_string($type) && Type::hasType($type)) {
            return Type::getType($type)->convertToDatabaseValue(
                $value,
                $this->connection->getDatabasePlatform()
            );
        }

        return $this->parameterToString($value);
    }
1175335
public static function string(&$value, $options = ['length'=>null, 'regex'=>null, 'default'=>null])
    {
        $value = htmlspecialchars(trim($value));
        self::processString($value, $options);
        return $value;
    }
381987
public function bindValue($parameter, $value, $type = null)
    {
        return $this->bindParam($parameter, $value, $type);
    }
913315
public static function decode(string $value, string $type = null)
    {
        return self::run(self::DECODER, $value, $type);
    }