Automattic\WooCommerce\Vendor\GraphQL\Language\AST

Node::cloneValueprotected staticWC 1.0

Method of the class: Node{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Node::cloneValue( $value );
$value(required)
.

Node::cloneValue() code WC 10.9.4

protected static function cloneValue($value)
{
    if ($value instanceof self) {
        $cloned = clone $value;
        foreach (get_object_vars($cloned) as $prop => $propValue) {
            $cloned->{$prop} = static::cloneValue($propValue); // @phpstan-ignore argument.templateType
        }

        return $cloned;
    }

    if ($value instanceof NodeList) {
        /**
         * @phpstan-var TCloneable
         *
         * @phpstan-ignore varTag.nativeType (PHPStan is strict about template types and sees NodeList<TNode> as potentially different from TCloneable)
         */
        return $value->cloneDeep();
    }

    return $value;
}