Inspects given $inputValue and potentially converts it into a dedicated value object.

@param mixed $inputValue

@return \eZ\Publish\Core\FieldType\Keyword\Value The potentially converted and structurally plausible value.
352107
protected function createValueFromInput($inputValue)
    {
        if (is_string($inputValue)) {
            $inputValue = array($inputValue);
        }

        if (is_array($inputValue)) {
            $inputValue = new Value($inputValue);
        }

        return $inputValue;
    }
206387
public function toValue($type = null, $valueAttribute = null)
    {
        $value = ($valueAttribute)? (string)$this[$valueAttribute] : (string)$this;
        $type = ($type)?: (string)$this['type'];

        switch ($type) {
            case 'int':
                $value = (int)$value;
                break;

            case 'float':
                $value = (float)$value;
                break;

            case 'bool':
                $value = $this->_toBoolean($value);
                break;

            case 'double':
                $value = (double)$value;
                break;

            case 'null':
                $value = null;
                break;

            case 'array':
                $value = $this->toArray(true);
                break;
        }

        return $value;
    }
1188150
public function removeValue(FieldValue $fieldValue)
    {
        if ($this->fieldValues->contains($fieldValue)) {
            $this->fieldValues->removeElement($fieldValue);
        }
    }
282772
public function inputValue($field)
    {
        $element = $this->resolver->resolveForTyping($field);

        return in_array($element->getTagName(), ['input', 'textarea'])
                        ? $element->getAttribute('value')
                        : $element->getText();
    }
561774
public static function fromString($headerValue)
    {
        $index = 0;

        return new self(array_map(function ($itemValue) use (&$index) {
            $item = AcceptHeaderItem::fromString($itemValue);
            $item->setIndex($index++);

            return $item;
        }, preg_split(
            '/\s*(?:,*("[^"]+"),*|,*(\'[^\']+\'),*|,+)\s*/',
            $headerValue,
            0,
            PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE
        )));
    }
1372981
public function fromPersistenceValue(FieldValue $fieldValue)
    {
        if ($fieldValue->externalData === null) {
            return $this->getEmptyValue();
        }

        return $this->fromHash($fieldValue->externalData);
    }
43956
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        /** @var \Illuminate\Database\Eloquent\Model $model */
        $model = $this->getModelClass();

        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($model) {
                $results = $resolveInfo
                    ->builder
                    ->addScopes(
                        $this->directiveArgValue('scopes', [])
                    )
                    ->apply(
                        $model::query(),
                        $args
                    )
                    ->get();

                if ($results->count() > 1) {
                    throw new Error('The query returned more than one result.');
                }

                return $results->first();
            }
        );
    }
1319486
public function setStringValue($stringValue)
    {
        if (\is_array($stringValue) || \is_object($stringValue)) {
            $m = "Invalid value type for attribute {$this->getFamilyCode()}.{$this->getAttributeCode()}, ";
            $m .= 'expecting string, got '.gettype($stringValue);
            throw new \UnexpectedValueException($m);
        }
        if (null !== $stringValue && 255 < \mb_strlen($stringValue)) {
            $stringValue = mb_substr($stringValue, 0, 255);
        }
        $this->stringValue = null === $stringValue ? null : (string) $stringValue;

        return $this;
    }
1049100
public function provideResolver(FieldValue $fieldValue): Closure
    {
        if ($fieldValue->parentIsRootType()) {
            $resolverClass = Utils::namespaceClassname(
                Str::studly($fieldValue->getFieldName()),
                $fieldValue->defaultNamespacesForParent(),
                function (string $class): bool {
                    return method_exists($class, 'resolve');
                }
            );

            if (! $resolverClass) {
                throw new DefinitionException(
                    "Could not locate a default resolver for the field {$fieldValue->getFieldName()}"
                );
            }

            return Closure::fromCallable(
                [app($resolverClass), 'resolve']
            );
        }

        return Closure::fromCallable(
            Executor::getDefaultFieldResolver()
        );
    }
895621
protected function applyFieldFilters($propertyValue)
    {
        $filterConfig = $this->field->getFilters();
        if (count($filterConfig)) {
            $filterCollection = $this->createFilterCollection($filterConfig);
            $propertyValue = $filterCollection->filter($propertyValue);
        }

        return $propertyValue;
    }
537777
public function getValue(string $key, $defaultValue = null)
    {
        if ($this->offsetExists($key)) {
            return $this->offsetGet($key);
        } else {
            return $defaultValue;
        }
    }
1276692
protected function getTypedValue ($rawValue) {
		if (gettype($rawValue) == "array") {
			foreach ($rawValue as $key => $value) {
				$rawValue[$key] = $this->getTypedValue($value);
			}
			return $rawValue; // array
		} else if (mb_strlen($rawValue) > 0) {
			if (is_numeric($rawValue)) {
				return $this->getTypedValueFloatOrInt($rawValue);
			} else {
				return $this->getTypedSpecialValueOrString($rawValue);
			}
		} else {
			return $this->getTypedSpecialValueOrString($rawValue);
		}
	}
159385
protected function option($name, $defaultValue = null)
    {
        $value = $this->getInput()->getOption($name);

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

        return $value;
    }
633401
protected function input(string $name, $defaultValue = null, bool $autoTrim = true)
    {
        $value = false;

        if ($this->request->getMethod() === 'GET') {
            if (isset($this->request->getQueryParams()[$name])) {
                $value = $this->request->getQueryParams()[$name];
            }
        }

        if ($this->request->getMethod() === 'POST') {
            if (isset($this->request->getParsedBody()[$name])) {
                $value = $this->request->getParsedBody()[$name];
            }
        }

        if ($value) {
            return (!$autoTrim) ? $value : trim($value);
        }

        return $defaultValue;
    }
14268
public function setDefaultValue($defaultValue)
    {
        if (!is_string($defaultValue)) {
            throw new \InvalidArgumentException('The attribute defaultValue on the class Attribute has to be string (' . gettype($defaultValue) . ('object' === gettype($defaultValue) ? ' ' . get_class($defaultValue) : '') . ' given).');
        }

        $this->defaultValue = $defaultValue;

        return $this;
    }
1151387
protected function findInputValueByName( $name, $inputArray )
    {
        foreach($inputArray as $key=>$value){
            if($key === $name) { // use === because plain == allowed numeric indexes to be equal to names
                return $value;
            }
            if (is_array($value)) {
                if (($result = $this->findInputValueByName($name,$value)) !== false) {
                    return $result;
                }
            }
        }

        return false;
    }
79675
protected function input($key = null, $defaultValue = null)
    {
        return is_null($key) ? $_REQUEST : fnGet($_REQUEST, $key, $defaultValue);
    }