Automattic\WooCommerce\Vendor\GraphQL\Language\AST

NodeList::splicepublicWC 1.0

Remove a portion of the NodeList and replace it with something else.

Method of the class: NodeList{}

No Hooks.

Returns

null. Nothing (null).

Usage

$NodeList = new NodeList();
$NodeList->splice( $offset, $length, $replacement ): NodeList;
$offset(int) (required)
.
$length(int) (required)
.
$replacement(T|iterable|null)
.
Default: null

NodeList::splice() code WC 10.9.1

public function splice(int $offset, int $length, $replacement = null): NodeList
{
    if (is_iterable($replacement) && ! is_array($replacement)) {
        $replacement = iterator_to_array($replacement);
    }

    return new NodeList(
        array_splice($this->nodes, $offset, $length, $replacement)
    );
}