Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

EnumType::didYouMeanprotectedWC 1.0

Method of the class: EnumType{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->didYouMean( $unknownValue ): ?string;
$unknownValue(string) (required)
.

EnumType::didYouMean() code WC 10.9.4

protected function didYouMean(string $unknownValue): ?string
{
    $suggestions = Utils::suggestionList(
        $unknownValue,
        array_map(
            static fn (EnumValueDefinition $value): string => $value->name,
            $this->getValues()
        )
    );

    return $suggestions === []
        ? null
        : ' Did you mean the enum value ' . Utils::quotedOrList($suggestions) . '?';
}