WooCommerce Code Reference

Value
in package

Tags
phpstan-type

CoercedValue array{errors: null, value: mixed}

phpstan-type

CoercedErrors array{errors: array<int, CoercionError>, value: null}

phpstan-import-type

InputPath from CoercionError

Table of Contents

coerceInputValue()  : array<string|int, mixed>
Coerce the given value to match the given Automattic\WooCommerce\Vendor\GraphQL Input Type.
add()  : array<int, CoercionError>
ofErrors()  : array<string|int, mixed>
ofValue()  : array<string|int, mixed>

Methods

coerceInputValue()

Coerce the given value to match the given Automattic\WooCommerce\Vendor\GraphQL Input Type.

public static coerceInputValue(mixed $value, InputType|Type $type[, array<string|int, mixed>|null $path = null ][, Schema|null $schema = null ]) : array<string|int, mixed>

Returns either a value which is valid for the provided type, or a list of encountered coercion errors.

Parameters
$value : mixed
$type : InputType|Type
$path : array<string|int, mixed>|null = null
$schema : Schema|null = null
Tags
phpstan-param

InputPath|null $path

throws
InvariantViolation
phpstan-return

CoercedValue|CoercedErrors

Return values
array<string|int, mixed>

ofValue()

private static ofValue(mixed $value) : array<string|int, mixed>
Parameters
$value : mixed

any value

Tags
phpstan-return

CoercedValue

Return values
array<string|int, mixed>