Convert argument definition to type.

@param  \Nuwave\Lighthouse\Schema\Values\ArgumentValue  $argumentValue
@return array
762408
public function handle(ArgumentValue $argumentValue): array
    {
        $definition = $argumentValue->getAstNode();

        $argumentType = $argumentValue->getType();

        $fieldArgument = [
            'name' => $argumentValue->getName(),
            'description' => data_get($definition->description, 'value'),
            'type' => $argumentType,
            'astNode' => $definition,
        ];

        if ($defaultValue = $definition->defaultValue) {
            $fieldArgument += [
                // webonyx/graphql-php expects the internal value here, whereas the
                // SDL uses the ENUM's name, so we run the conversion here
                'defaultValue' => $argumentType instanceof EnumType
                    ? $argumentType->getValue($defaultValue->value)->value
                    : AST::valueFromASTUntyped($defaultValue),
            ];
        }

        // Add any dynamically declared public properties of the FieldArgument
        $fieldArgument += get_object_vars($argumentValue);

        // Used to construct a FieldArgument class
        return $fieldArgument;
    }
1315766
protected function validator($inputValue)
    {
        if ('' === $inputValue) {
            if ($this->mandatory) {
                $this->addError(
                    $this->getEnvironment()->getTranslator()->translate('mandatory', 'ERR', [$this->strLabel])
                );
            }

            return '';
        }

        $inputValue = \array_map('\Contao\StringUtil::uuidToBin', \array_filter(\explode(',', $inputValue)));

        return $this->multiple ? $inputValue : $inputValue[0];
    }
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;
    }
512186
public function getOptsValues($argv=null) {
    $parsed_args = ArgumentsParser::parseArgvWithSpec($this->resolveArgv($argv), $this->arguments_spec);
    return new ArgumentValues($this->arguments_spec, $parsed_args);
  }
1347005
protected function validator($inputValue)
    {
        $translator = $this->getEnvironment()->getTranslator();

        $widgetValue = $this->widgetToValue($inputValue);
        if ((null === $widgetValue) && $this->mandatory) {
            $this->addError($translator->translate('mandatory', 'ERR', [$this->strLabel]));
        }

        return $widgetValue;
    }
487107
public function setDefaultValue($defaultValue)
    {
        if (is_float($defaultValue)) {
            $this->defaultValue = $defaultValue;
        } else {
            $msg = "The defaultValue argument must be a numeric value, '" . gettype($defaultValue) . "'.";
            throw new InvalidArgumentException($msg);
        }
    }
487650
public function formatArgs($args)
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $parts = explode('\\', $item[1]);
                $short = array_pop($parts);
                $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short);
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), ENT_COMPAT | ENT_SUBSTITUTE, $this->charset));
            }

            $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
        }

        return implode(', ', $result);
    }
679293
public function CompareTo( $obj )
	{
		if ( ! $obj instanceof Integer )
		{
			throw new ArgumentException( "The type '$obj' cannot be Converted to a type Integer" );
		}

		return ( $this->_value < $obj->getValue() ) ? -1 : (( $this->_value > $obj->getValue() ) ? 1 : 0);
	}
583159
public function normalize($clearValue)
    {
        $normalizedValue = null;

        if ($clearValue !== null) {
            $primitiveConversor = static::$allowedPrimitives[$this->primitive];
            $primivitveValue = $clearValue !== null ? call_user_func($primitiveConversor, $clearValue) : null;
            $normalizedValue = $primivitveValue;
        }

        return $normalizedValue;
    }
1260638
protected function createValueFromInput( $inputValue )
    {
        if ( is_array( $inputValue ) )
        {
            foreach ( $inputValue as $index => $inputValueItem )
            {
                if ( !$inputValueItem instanceof Meta )
                {
                    throw new InvalidArgumentType(
                        '$inputValue[' . $index . ']',
                        "\\Novactive\\Bundle\\SEOBundle\\API\\Repository\\Values\\Metas\\Meta",
                        $inputValueItem
                    );
                }
            }
            $inputValue = new Value( $inputValue );
        }

        return $inputValue;
    }
961994
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
    {
        return [
            '__identity' => $this->persistenceManager->getIdentifierByObject($source),
            '__type' => TypeHandling::getTypeForValue($source)
        ];
    }
461615
public static function buildValueType(string $identifier, array $config): ValueType
    {
        return ValueType::fromArray(
            [
                'identifier' => $identifier,
                'isEnabled' => $config['enabled'],
                'name' => $config['name'],
            ]
        );
    }
688572
public static function argValue(ArgumentNode $arg, $default = null)
    {
        $valueNode = $arg->value;

        if (! $valueNode) {
            return $default;
        }

        return AST::valueFromASTUntyped($valueNode);
    }
181895
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo): LengthAwarePaginator {
                /** @var int $first */
                /** @var int $page */
                [$first, $page] = PaginationUtils::extractArgs($args, $this->paginationType(), $this->paginateMaxCount());

                if ($this->directiveHasArgument('builder')) {
                    $query = call_user_func(
                        $this->getResolverFromArgument('builder'),
                        $root,
                        $args,
                        $context,
                        $resolveInfo
                    );
                } else {
                    /** @var \Illuminate\Database\Eloquent\Model $model */
                    $model = $this->getPaginatorModel();
                    $query = $model::query();
                }

                $query = $resolveInfo
                    ->builder
                    ->addScopes(
                        $this->directiveArgValue('scopes', [])
                    )
                    ->apply(
                        $query,
                        $args
                    );

                if ($query instanceof ScoutBuilder) {
                    return $query->paginate($first, 'page', $page);
                }

                return $query->paginate($first, ['*'], 'page', $page);
            }
        );
    }
403419
public function setDefaultValue($defaultValue)
    {
        if (is_numeric($defaultValue)) {
            $this->defaultValue = $defaultValue;
        } else {
            $msg = "The 'defaultValue' argument must be a numeric value, '" . gettype($defaultValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
542799
private function querifyFieldValue($fieldValue)
    {
        if (is_array($fieldValue) && count($fieldValue) > 1) {
            sort($fieldValue);

            $quoted = array_map(function($value) {
                return '"'. $value .'"';
            }, $fieldValue);

            $fieldValue = implode(' TO ', $quoted);
            $fieldValue = '['. $fieldValue . ']';

            return $fieldValue;
        }

        if (is_array($fieldValue) && count($fieldValue) === 1) {
            $fieldValue = array_pop($fieldValue);
        }

        if ($this->useWildcards) {
            $fieldValue = '*' . $fieldValue . '*';
        }

        $termParts = explode(' ', $fieldValue);
        if (count($termParts) > 1) {
            $fieldValue = '"'.$fieldValue.'"';
        }

        return $fieldValue;
    }
33760
public static function convertContributors($value, $prevValue)
    {
        $mergeValue = \is_array($prevValue) ? $prevValue : array();
        $mergeValue = array_merge($mergeValue, \is_array($value) ? $value : array());

        if (\count($mergeValue) > 0) {
            $value = $mergeValue;
        }

        return $value;
    }