FluentDOM\Query::applyToSpawn PHP Method

applyToSpawn() private method

Apply the content to the target nodes using the handler callback and push them into a spawned Query object.
private applyToSpawn ( array | DOMNodeList $targetNodes, string | array | DOMNode | DOMNodeList | Traversable | callable $content, callable $handler, boolean $remove = FALSE ) : Query
$targetNodes array | DOMNodeList
$content string | array | DOMNode | DOMNodeList | Traversable | callable
$handler callable
$remove boolean Call remove() on $this, remove the current selection from the DOM
return Query
    private function applyToSpawn($targetNodes, $content, callable $handler, $remove = FALSE)
    {
        $result = $this->spawn($this->apply($targetNodes, $content, $handler));
        if ($remove) {
            $this->remove();
        }
        return $result;
    }