Returns a array with the given value (name, value and options).

@param $name
@param $value
@param array $options
@param string $type
@param array $children

@return array
15481
protected function createProperty($name, $value = null, $options = [], $type = '', $children = null)
    {
        $property = [
            'name' => $name,
            'type' => $type,
            'options' => $options,
        ];

        if ($children) {
            $property['children'] = $children;
        } else {
            $property['value'] = $value;
        }

        return $property;
    }
786227
public function addChild($child, $name = null, $type = self::TYPE_DEFAULT) {
		if (! $child instanceof Descriptor) {
			$child = new static($child, $type);
		}
		
		if ($name === null) {
			$this->_children[] = $child;
			return $child;
		}
		
		$this->_children[$name] = $child;
		return $child;
	}
633179
public function label($name, $value = null, $options = [])
    {
        return parent::label($name, $value, $this->appendErrors($name, $options));
    }
312213
public static function email($name, $value = null, array $options = [])
    {
        self::exclure($options);

        return self::input('email', $name, $value, $options);
    }
834280
public function checkbox($name, $value = 1, $checked = null, $options = array())
    {
        return $this->checkable('checkbox', $name, $value, $checked, $options);
    }
326237
public function createNew(
        int $sourceId,
        string $name,
        $value,
        $type = null
    ) : array {
        if ($type === null) {
            $type = $this->typeInfer($value);
        }

        return $this->sendPost(
            sprintf('/profiles/%s/features', $this->userName),
            [],
            [
                'source_id' => $sourceId,
                'name'      => $name,
                'value'     => $value,
                'type'      => $type
            ]
        );
    }
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;
    }
1095850
protected function filterByTranslatableColumn($name, $type, $value)
    {
        $translation = $this->model->getTranslationModel();

        return $this->query->whereHas('translations', function ($query) use ($translation, $name, $type, $value) {
            return $query = $this->applyQueryElementByType($query, $translation->getTable(), $name, $type, $value);
        });
    }
124543
public function tel($name, $value = null, $options = [])
    {
        return $this->input('tel', $name, $value, $options);
    }
487944
public function hidden($name, $value = null, $options = [])
    {
        return $this->input('hidden', $name, $value, $options);
    }
723539
public function exchange($name, $type = ExchangeType::DIRECT, array $options = [])
    {
        return $this->exchanges[$name] = (new ExchangeBuilder($this, $name, $type))->options($options);
    }
591725
final protected function getOptionalStringArray(array $values, string $name, bool $isFirst = false) : array
    {
        if (isset($values[$name])) {
            $value = $values[$name];
        } elseif ($isFirst && isset($values['value'])) {
            $value = $values['value'];
        } else {
            return [];
        }

        if (is_string($value)) {
            return [$value];
        }

        if (is_array($value)) {
            foreach ($value as $item) {
                if (! is_string($item)) {
                    throw new \LogicException(sprintf(
                        'Attribute "%s" of annotation %s expects an array of strings, %s found in array.',
                        $name,
                        $this->getAnnotationName(),
                        gettype($item)
                    ));
                }
            }

            return $value;
        }

        throw new \LogicException(sprintf(
            'Attribute "%s" of annotation %s expects a string or array of strings, %s given.',
            $name,
            $this->getAnnotationName(),
            gettype($value)
        ));
    }
1373491
public function inputer($name, $value = null, $options = array())
    {
        $data = [
            'input_name' => $name,
            'input_id' => $name,
            'input_value' => $value
        ];
        
        // Check for class
        if (array_key_exists('class', $options)) {
            $data['wrapper_classes'] = $options['class']; // Save value
            unset($options['class']); // Remove key from array
        }
        
        // Check for ID
        if (array_key_exists('id', $options)) {
            $data['input_id'] = $options['id']; // Save value
            unset($options['id']); // Remove key from array
        }
        
        // Check for Label
        if (array_key_exists('label', $options)) {
            $data['label'] = $options['label']; // Save value
            unset($options['label']); // Remove key from array
        }
        
        // Check for Label Class
        if (array_key_exists('label_classes', $options)) {
            $data['label_classes'] = $options['label_classes']; // Save value
            unset($options['label_classes']); // Remove key from array
        }
        
        // Check for Help Text
        if (array_key_exists('help_text', $options)) {
            $data['help_text'] = $options['help_text']; // Save value
            unset($options['help_text']); // Remove key from array
        }
        
        $data['input_options'] = $options; // Remaining options
                
        return view('redminportal::partials.form-input', $data);
    }
350418
public static function ReflectOptions ($name, $value, $options) {
		if (!isset($options['options'][$name])) {
			return $value;
		}
		if (isset($options['options'][$name]['prefix'])) {
			$value = $options['options'][$name]['prefix'] . $value;
		}
		if (isset($options['options'][$name]['safix'])) {
			$value .= $options['options'][$name]['safix'];
		}
		return $value;
	}
575134
protected function bindValues($name, $type, $values)
    {
        if (!is_array($values)) {
            return $this->builder->createNamedParameter($values, $type);
        }

        foreach ($values as $key => $value) {
            $values[$key] = $this->bindValues($name, $type, $value);
        }

        return $values;
    }
483
public function addChild($child, array $options = array())
    {
        $child->setParent($this);

        $this->children[$child->getName()] = $child;

        return $child;
    }
19462
public function apply($value, $options = [])
    {
        $type = isset($options[0]) ? $options[0] : null;
        switch ($type) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'object':
                return is_array($value) ? (object) $value : json_decode($value, false);
            case 'array':
                return json_decode($value, true);
            case 'collection':
                $array = is_array($value) ? $value : json_decode($value, true);
                return new Collection($array);
            default:
                throw new \InvalidArgumentException("Wrong Sanitizer casting format: {$type}.");
        }
    }