WooCommerce Code Reference

ListOfType extends Type
in package
implements WrappingType, OutputType, NullableType, InputType

Registry of built-in Automattic\WooCommerce\Vendor\GraphQL types and base class for all other types.

Tags
template-covariant

OfType of Type

Interfaces, Classes and Traits

WrappingType
OutputType
NullableType
InputType
export type InputType = | ScalarType | EnumType | InputObjectType | ListOfType<InputType> | NonNull< | ScalarType | EnumType | InputObjectType | ListOfType<InputType>, >;.

Table of Contents

BOOLEAN  = 'Boolean'
BUILT_IN_SCALAR_NAMES  = [self::INT, self::FLOAT, self::STRING, self::BOOLEAN, self::ID]
BUILT_IN_TYPE_NAMES  = [...self::BUILT_IN_SCALAR_NAMES, ...AutomatticWooCommerceVendorGraphQLTypeIntrospection::TYPE_NAMES]
Names of all built-in types: built-in scalars and introspection types.
FLOAT  = 'Float'
ID  = 'ID'
INT  = 'Int'
STANDARD_TYPE_NAMES  = self::BUILT_IN_SCALAR_NAMES
STRING  = 'String'
$builtInScalars  : array<string|int, mixed>|null
$builtInTypes  : array<string|int, mixed>|null
$wrappedType  : Type|callable
__construct()  : mixed
__toString()  : string
boolean()  : ScalarType
Returns the built-in Boolean scalar type.
builtInScalars()  : array<string, ScalarType>
Returns all built-in scalar types.
builtInTypes()  : array<string, \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType>
Returns all built-in types: built-in scalars and introspection types.
float()  : ScalarType
Returns the built-in Float scalar type.
getInnermostType()  : Type|NamedType
Return the innermost wrapped type, which is guaranteed to be a named type.
getNamedType()  : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType)|null
Returns the underlying named type of the given type.
getNullableType()  : Type|NullableType
Unwraps a potentially non-null type to return the underlying nullable type.
getStandardTypes()  : array<string, ScalarType>
Returns all built-in scalar types.
getWrappedType()  : Type
Return the wrapped type, which may itself be a wrapping type.
id()  : ScalarType
Returns the built-in ID scalar type.
int()  : ScalarType
Returns the built-in Int scalar type.
isAbstractType()  : bool
Determines if the given type is an abstract type.
isBuiltInScalar()  : bool
Determines if the given type is a built-in scalar (Int, Float, String, Boolean, ID).
isBuiltInScalarName()  : bool
Checks if the given name is one of the built-in scalar type names (ID, String, Int, Float, Boolean).
isCompositeType()  : bool
Determines if the given type is a composite type.
isInputType()  : bool
Determines if the given type is an input type.
isLeafType()  : bool
Determines if the given type is a leaf type.
isOutputType()  : bool
Determines if the given type is an output type.
jsonSerialize()  : string
listOf()  : ListOfType<string|int, T>
Wraps the given type in a list type.
nonNull()  : NonNull
Wraps the given type in a non-null type.
overrideStandardTypes()  : void
Allows partially or completely overriding the standard types globally.
string()  : ScalarType
Returns the built-in String scalar type.
toString()  : string

Constants

BUILT_IN_TYPE_NAMES

Names of all built-in types: built-in scalars and introspection types.

public array<int, string> BUILT_IN_TYPE_NAMES = [...self::BUILT_IN_SCALAR_NAMES, ...AutomatticWooCommerceVendorGraphQLTypeIntrospection::TYPE_NAMES]
Tags
see
Type::BUILT_IN_SCALAR_NAMES

for just the built-in scalar names.

Properties

Methods

builtInTypes()

Returns all built-in types: built-in scalars and introspection types.

public static builtInTypes() : array<string, \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType>
Return values
array<string, \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType>

getNamedType()

Returns the underlying named type of the given type.

public static getNamedType(Type|null $type) : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType)|null
Parameters
$type : Type|null
Tags
phpstan-return

($type is null ? null : Type&NamedType)

Return values
(\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType)|null

isBuiltInScalar()

Determines if the given type is a built-in scalar (Int, Float, String, Boolean, ID).

public static isBuiltInScalar(mixed $type) : bool

Does not unwrap NonNull/List wrappers — checks the type instance directly. ScalarType is a NamedType, so {@see} is unnecessary.

Parameters
$type : mixed
Tags
phpstan-assert-if-true

ScalarType $type

Return values
bool

isBuiltInScalarName()

Checks if the given name is one of the built-in scalar type names (ID, String, Int, Float, Boolean).

public static isBuiltInScalarName(string $name) : bool
Parameters
$name : string
Return values
bool

nonNull()

Wraps the given type in a non-null type.

public static nonNull(NonNull|(\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NullableType&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type)|callable $type) : NonNull
Parameters
$type : NonNull|(\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NullableType&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type)|callable
Return values
NonNull