@param mixed  $value
@param string $type
@param string $name

@throws Exception\RuntimeException
@throws Exception\LogicException
345616
protected function validateType($value, $type, $name)
    {
        if (empty($type) || $type === 'mixed') {
            return;
        }

        if (isset($this->typeMap[$type])) {
            $test = 'is_' . $this->typeMap[$type];

            if (!call_user_func($test, $value)) {
                $givenType = gettype($value);

                throw new RuntimeException("Expected property '{$name}' to be a '{$type}'. '{$givenType}' given.");
            }

            return;
        }

        if (class_exists($type)) {
            if (!($value instanceof $type)) {
                $givenType = gettype($value);

                throw new RuntimeException("Expected property '{$name}' to be a '{$type}'. '{$givenType}' given.");
            }

            return;
        }

        throw new LogicException("Unrecognized type '{$type}' for property '{$name}'");
    }
853400
protected function typeById($value, $name, $clear = false)
    {
        return $this->typeBySelectorType('id', $value, $name, $clear);
    }
522594
public function set(string $name, $value, int $type = self::TYPE_LOCAL): OptionList
    {
        if ($type == self::TYPE_GLOBAL) {
            self::$globalOptions[$name] = $value;
        } else {
            $this->options[$name] = $value;
        }

        return $this;
    }
771747
protected function executeItems($type, $name, $value = null)
    {
        if (!isset($this->handlers[$type][$name])) {
            return $value;
        }
        
        $request = $this->framework->getRequest();

        foreach ($this->filterHandlers($type, $name, $request) as $handlerName) {
            $handler = $this->framework->getInstance($handlerName);
                
            $response = $this->framework->getResponse();
            $response->setData('_executedType', $type);
            $response->setData('_executedName', $name);
                
            // Execute the handler
            $handlerResult = $handler->execute(
                $this->framework, 
                $this->framework->getRequest(), 
                $response,
                $value
            );
                
            // Save the handler result to the variable if this is an filter handler
            if ($type === self::FILTER) {
                $value = $handlerResult;
            }
        }
        
        // Return the value if this is an filter handler
        if ($type === self::FILTER) {
            return $value;
        }
    }
1018801
public function bind($param, $value, $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;
            }
        }
        //then run PDO bindValue on the statement to bind the values
        self::$statement->bindValue($param, $value, $type);
    }
392894
public void addField(String name, Object value, Object type) {
        if (value == null) {
            this.fields.add(new Field(name, null, null));
        } else {
            this.fields.add(new Field(name, value.toString(), type.toString()));
        }
    }
455087
protected function setFormParameter(string $name, string $value): void
    {
        $this->formParameters->set($name, $value);
    }
608033
public function setParameter($name, $value, $type = null)
    {
        $this->filter->setParameter($name, $value, $type);

        return $this;
    }
925641
public function input($type, $name, $value = null, $options = [])
    {
        // Don't add form-control for some input types (like submit, checkbox, radio)
        if (!in_array($type, ['submit', 'checkbox', 'radio', 'reset', 'file'])) {
            $options = $this->appendClassToOptions('form-control', $options);
        } else if (in_array($type, ['submit', 'reset'])) {
            $options = $this->appendClassToOptions('btn', $options);
        }

        // Call the parent input method so that Laravel can handle
        // the rest of the input set up.
        return parent::input($type, $name, $value, $options);
    }
65563
public function input($type, $name, $value = null)
    {
        $value = $this->inputs ? $this->inputs->get($name, $value) : $value;
        $form  = (new Input($type, $name))->value($value);
        return $this->setClass($form);
    }
381987
public function bindValue($parameter, $value, $type = null)
    {
        return $this->bindParam($parameter, $value, $type);
    }
796291
public function setColumnValue(string $name, $value): void
	{
		$value = $this->cast($name, $value);

		if(method_exists($this, $name . 'Mutator'))
		{
			$this->columns[$name] = $this->{$name . 'Mutator'}($value);
		}
		else
		{
			$this->columns[$name] = $value;
		}
	}
324704
final public function setValueType(&$value, $type) {

        if ( empty($value) || !in_array(strtolower($type), array("base64", "datetime", "cdata")) ) throw new XmlrpcException("Invalid value type");

        $this->special_types[$value] = strtolower($type);

        return $this;

    }
1113459
public function override(string $name, Type $type) : void
    {
        if (! isset($this->instances[$name])) {
            throw DBALException::typeNotFound($name);
        }

        if (! in_array($this->findTypeName($type), [$name, null], true)) {
            throw DBALException::typeAlreadyRegistered($type);
        }

        $this->instances[$name] = $type;
    }
998198
public static function setType($value, $type, $nullable = TRUE)
	{
		if (!$nullable || NULL !== $value) {
			settype($value, $type);
		}

		return $value;
	}
363587
public function plainInput($type, $name, $value = null, $options = [])
    {
        return parent::input($type, $name, $value, $options);
    }
182749
private function ___set($name, $value)
    {
        /**
         * @var PropertyContract $meta
         */
        $meta = self::$schema->getPropertyEntryByIdentifier($name);

        if (!$meta) {
            return;
        }

        $isRequired = $meta->getBehavior()->isRequired();

        if (is_null($value) && $isRequired) {
            throw new Exception("Propriedade obrigatória não pode ser nula [ " . $name . " ]", 400);
        }

        if ($value) {
            $value = Validator::make(self::$schema)->validate($name, $value);

            if ($meta->getAllowedValues()) {

                if (!in_array($value, $meta->getAllowedValues())) {

                    $msg = "Valor [ {$value} ] para [ {$name} ] esta fora do intervalo permitido ";
                    $msg .= '[ ' . implode(',', $meta->getAllowedValues()) . ' ]';

                    throw new Exception($msg, 400);
                }
            }
        }

        if (method_exists($this, 'set' . ucfirst($name))) {
            $this->{'set' . ucfirst($name)}($value);
        } else {
            $this->{$name} = $value;
        }
    }