Automattic\WooCommerce\Vendor\GraphQL\Executor

ReferenceExecutor::fixResultsIfEmptyArrayprotected staticWC 1.0

Differentiate empty objects from empty lists.

Method of the class: ReferenceExecutor{}

No Hooks.

Returns

non-empty-Array|\stdClass|Mixed.

Usage

$result = ReferenceExecutor::fixResultsIfEmptyArray( $results );
$results(array|mixed) (required)
.

Notes

ReferenceExecutor::fixResultsIfEmptyArray() code WC 10.9.1

protected static function fixResultsIfEmptyArray($results)
{
    if ($results === []) {
        return new \stdClass();
    }

    return $results;
}