WooCommerce Code Reference

Values
in package

Tags
see
ArgumentNode
  • force IDE import
see
ValuesTest
phpstan-import-type

ArgumentNodeValue from ArgumentNode

Table of Contents

getArgumentValues()  : array<string, mixed>
Prepares an object map of argument values given a list of argument definitions and list of argument AST nodes.
getArgumentValuesForMap()  : array<string, mixed>
getDirectiveValues()  : array<string, mixed>|null
Prepares an object map of argument values given a directive definition and an AST node which may contain directives. Optionally also accepts a map of variable values.
getVariableValues()  : array{: array, : null}|array{: null, : array}
Prepares an object map of variables of the correct type based on the provided variable definitions and arbitrary input. If the input cannot be coerced to match the variable definitions, an Error will be thrown.

Methods

getArgumentValues()

Prepares an object map of argument values given a list of argument definitions and list of argument AST nodes.

public static getArgumentValues(FieldDefinition|Directive $def, FieldNode|DirectiveNode $node[, array<string, mixed>|null $variableValues = null ][, Schema|null $schema = null ]) : array<string, mixed>
Parameters
$def : FieldDefinition|Directive
$node : FieldNode|DirectiveNode
$variableValues : array<string, mixed>|null = null
$schema : Schema|null = null
Tags
throws
Exception
throws
Error
Return values
array<string, mixed>

getArgumentValuesForMap()

public static getArgumentValuesForMap(FieldDefinition|Directive $def, array<string, ArgumentNodeValue$argumentValueMap[, array<string, mixed>|null $variableValues = null ][, Node|null $referenceNode = null ][, Schema|null $schema = null ]) : array<string, mixed>
Parameters
$def : FieldDefinition|Directive
$argumentValueMap : array<string, ArgumentNodeValue>
$variableValues : array<string, mixed>|null = null
$referenceNode : Node|null = null
$schema : Schema|null = null
Tags
throws
Exception
throws
Error
Return values
array<string, mixed>

getDirectiveValues()

Prepares an object map of argument values given a directive definition and an AST node which may contain directives. Optionally also accepts a map of variable values.

public static getDirectiveValues(Directive $directiveDef, EnumTypeDefinitionNode|EnumTypeExtensionNode|EnumValueDefinitionNode|FieldDefinitionNode|FieldNode|FragmentDefinitionNode|FragmentSpreadNode|InlineFragmentNode|InputObjectTypeDefinitionNode|InputObjectTypeExtensionNode|InputValueDefinitionNode|InterfaceTypeDefinitionNode|InterfaceTypeExtensionNode|ObjectTypeDefinitionNode|ObjectTypeExtensionNode|OperationDefinitionNode|ScalarTypeDefinitionNode|ScalarTypeExtensionNode|SchemaExtensionNode|UnionTypeDefinitionNode|UnionTypeExtensionNode|VariableDefinitionNode $node[, array<string, mixed>|null $variableValues = null ][, Schema|null $schema = null ]) : array<string, mixed>|null

If the directive does not exist on the node, returns undefined.

Parameters
$directiveDef : Directive
$node : EnumTypeDefinitionNode|EnumTypeExtensionNode|EnumValueDefinitionNode|FieldDefinitionNode|FieldNode|FragmentDefinitionNode|FragmentSpreadNode|InlineFragmentNode|InputObjectTypeDefinitionNode|InputObjectTypeExtensionNode|InputValueDefinitionNode|InterfaceTypeDefinitionNode|InterfaceTypeExtensionNode|ObjectTypeDefinitionNode|ObjectTypeExtensionNode|OperationDefinitionNode|ScalarTypeDefinitionNode|ScalarTypeExtensionNode|SchemaExtensionNode|UnionTypeDefinitionNode|UnionTypeExtensionNode|VariableDefinitionNode
$variableValues : array<string, mixed>|null = null
$schema : Schema|null = null
Tags
throws
Exception
throws
Error
Return values
array<string, mixed>|null

getVariableValues()

Prepares an object map of variables of the correct type based on the provided variable definitions and arbitrary input. If the input cannot be coerced to match the variable definitions, an Error will be thrown.

public static getVariableValues(Schema $schema, NodeList<string|int, VariableDefinitionNode$varDefNodes, array<string, mixed> $rawVariableValues) : array{: array, : null}|array{: null, : array}
Parameters
$schema : Schema
$varDefNodes : NodeList<string|int, VariableDefinitionNode>
$rawVariableValues : array<string, mixed>
Tags
throws
Exception
Return values
array{: array, : null}|array{: null, : array}