Automattic\WooCommerce\Vendor\GraphQL\Validator\Rules
PossibleTypeExtensions::typeToExtKind
Метод класса: PossibleTypeExtensions{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = PossibleTypeExtensions::typeToExtKind( $type ): string;
- $type(NamedType) (обязательный)
- .
Код PossibleTypeExtensions::typeToExtKind() PossibleTypeExtensions::typeToExtKind WC 11.0.1
private static function typeToExtKind(NamedType $type): string
{
switch (true) {
case $type instanceof ScalarType:
return NodeKind::SCALAR_TYPE_EXTENSION;
case $type instanceof ObjectType:
return NodeKind::OBJECT_TYPE_EXTENSION;
case $type instanceof InterfaceType:
return NodeKind::INTERFACE_TYPE_EXTENSION;
case $type instanceof UnionType:
return NodeKind::UNION_TYPE_EXTENSION;
case $type instanceof EnumType:
return NodeKind::ENUM_TYPE_EXTENSION;
case $type instanceof InputObjectType:
return NodeKind::INPUT_OBJECT_TYPE_EXTENSION;
default:
$unexpectedType = Utils::printSafe($type);
throw new InvariantViolation("Unexpected type: {$unexpectedType}.");
}
}