Removes a object/array node.

If the last node to remove does not exist, no Exception will be thrown
To have a strict behaviour use together with has()

@param mixed                $node
@param JsonPointerInterface $pointer

@throws InvalidPathException
167780
public function delete(&$node, JsonPointerInterface $pointer)
    {
        $pathElements = $pointer->toArray();
        if (!$pathElements) {
            throw new InvalidPathException('Cannot delete root document');
        }
        $lastPath = array_pop($pathElements);
        $lastNode = & $this->getNodeReference($node, $pathElements);

        $accessor = $this->getAccessorForNode($lastNode, $pointer, $lastPath);
        $isAssocArray = $this->isAssociativeArray($lastNode);
        $accessor->delete($lastNode, $lastPath);

        if (!$isAssocArray) {
            $lastNode = array_values($lastNode);
        }
    }
672060
public function remove(Node $node)
    {
        unset($this->_children[$this->indexOf($node)]);
        $this->_children = array_values($this->_children);
        return $this;
    }
108315
private function checkAndTransformKey($key, $node)
    {
        if ('-' === $key || ($this->isIntegerKey($key) && (!is_array($node) || count($node)))) {
            if (!is_array($node) || $this->isAssociativeArray($node)) {
                throw new InvalidPathException(
                    sprintf('Used "%s" but array was not an array or is associative.', $key)
                );
            }
            $key = '-' === $key ? count($node) : (int) $key;
        }

        return $key;
    }
258497
private function removeLocalizedNodeProperties(NodeInterface $node, $locale)
    {
        // remove all localized system properties from the node
        foreach ($node->getProperties($this->propertyEncoder->localizedSystemName('', $locale) . '*') as $property) {
            $property->remove();
        }

        // remove all localized content properties from the node
        foreach ($node->getProperties($this->propertyEncoder->localizedContentName('', $locale) . '*') as $property) {
            $property->remove();
        }
    }
116703
public function removeValue($data, $keys)
    {
        if ($this->isKeysEmpty($keys)) {
            return;
        }
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        $accessor = new Accessor($data);
        $keyCount = count($keys);
        $depth    = 0;
        foreach ($keys as $key) {
            if ($depth + 1 === $keyCount) {
                if ($accessor->remove($key) === false) {
                    throw new InvalidArgumentException(sprintf(
                        'Did not remove path %s in structure %s',
                        json_encode($keys),
                        json_encode($data)
                    ));
                }
            } elseif ($accessor->to($key) === false) {
                throw new InvalidArgumentException(sprintf(
                    'Did not find path %s in structure %s',
                    json_encode($keys),
                    json_encode($data)
                ));
            }

            ++$depth;
        }

        return $accessor->getData();
    }
1046398
public function remove($entity)
    {
        if (!is_object($entity)) {
            throw new InvalidArgumentException("Only objects can be registered in Unit of Work.");
        }

        if (!$this->isRegistered($entity)) {
            if (!$this->identifier->isPersisted($entity)) {
                throw new RuntimeException("Unit of Work can't remove not persisted entities.");
            }
        }

        $this->registry->remove($entity);
    }
1234562
public static function remove_node($node) {
		if (
			! \is_a($node, 'DOMElement') &&
			! \is_a($node, 'DOMNode')
		) {
			return false;
		}

		$node->parentNode->removeChild($node);

		return true;
	}
124448
public function remove($item)
    {
        if (!($item instanceof $this->dataClass)) {
            throw new InvalidArgumentException(
                "HasManyList::remove() expecting a $this->dataClass object, or ID",
                E_USER_ERROR
            );
        }

        // Don't remove item with unrelated class key
        $foreignClass = $this->getForeignClass();
        $classNames = ClassInfo::subclassesFor($foreignClass);
        $classForeignKey = $this->classForeignKey;
        $classValueLower = strtolower($item->$classForeignKey);
        if (!array_key_exists($classValueLower, $classNames)) {
            return;
        }

        // Don't remove item which doesn't belong to this list
        $foreignID = $this->getForeignID();
        $foreignKey = $this->foreignKey;

        if (empty($foreignID)
            || $foreignID == $item->$foreignKey
            || (is_array($foreignID) && in_array($item->$foreignKey, $foreignID))
        ) {
            $item->$foreignKey = null;
            $item->$classForeignKey = null;
            $item->write();
        }
    }
1208484
public static function removeOrphan(array &$nodes = []) {
        do {
            $found = false;
            foreach ($nodes as $k => $v) {
                if (false === ($v instanceof AlphabeticalTreeNodeInterface) || null === $v->getAlphabeticalTreeNodeParent() || true === in_array($v->getAlphabeticalTreeNodeParent(), $nodes)) {
                    continue;
                }
                unset($nodes[$k]);
                $found = true;
            }
        } while (true === $found);
    }
164103
function delete($key) {
        if(\is_array($key) || \is_object($key)) {
            throw new \InvalidArgumentException('Key can not be an array or object');
        }
        
        $key = (string) $key;
        return parent::delete($key);
    }
306668
private void delete(Node<K, V> n) {
        if (n != root && n.o_s == null && n.poolIndex == Node.NO_INDEX) {
            // no root, no parent and no pool index
            throw new IllegalArgumentException("Invalid handle!");
        }

        // node has a parent
        if (n.o_s != null) {
            // cut oldest child
            Node<K, V> oldestChild = cutOldestChild(n);
            if (oldestChild != null) {
                linkInPlace(oldestChild, n);
            } else {
                cutFromParent(n);
            }
        }

        // node has no parent
        // cut children
        Node<K, V> childrenTree = combine(cutChildren(n));
        boolean checkConsolidate = false;
        if (childrenTree != null) {
            checkConsolidate = true;
            addPool(childrenTree, true);
        }

        size--;
        if (n == root) {
            root = null;
            consolidate();
            checkConsolidate = false;
        } else if (n.poolIndex != Node.NO_INDEX) {
            byte curIndex = n.poolIndex;
            decreasePool[curIndex] = decreasePool[decreasePoolSize - 1];
            decreasePool[curIndex].poolIndex = curIndex;
            decreasePool[decreasePoolSize - 1] = null;
            decreasePoolSize--;
            n.poolIndex = Node.NO_INDEX;
            if (curIndex == decreasePoolMinPos) {
                // in decrease pool, and also the minimum
                consolidate();
                checkConsolidate = false;
            } else {
                // in decrease pool, and not the minimum
                if (decreasePoolMinPos == decreasePoolSize) {
                    decreasePoolMinPos = curIndex;
                }
                checkConsolidate = true;
            }
        }

        // if decrease pool has >= ceil(logn) trees, consolidate
        if (checkConsolidate) {
            double sizeAsDouble = size;
            if (decreasePoolSize >= Math.getExponent(sizeAsDouble) + 1) {
                consolidate();
            }
        }
    }
918902
public function remove($key = null)
    {
        if ($key instanceof PageInterface) {
            $key = $key->path();
        } elseif (null === $key) {
            $key = (string)key($this->items);
        }
        if (!\is_string($key)) {
            throw new \InvalidArgumentException('Invalid argument $key.');
        }

        parent::remove($key);

        return $this;
    }
110173
public function get($pointer)
    {
        $value = $this->traverse($pointer);

        if ($value instanceof NonExistentValue) {
            throw InvalidPointerException::nonexistentValue($value->getValue(), $value->getPointer());
        }

        return $value;
    }
174476
protected void delete(Node<K, V> n) {
        if (n == root) {
            deleteMin();
            return;
        }

        if (n.y_s == null) {
            throw new IllegalArgumentException("Invalid handle!");
        }

        // disconnect and union children of node
        Node<K, V> childTree = unlinkAndUnionChildren(n);

        // find parent
        Node<K, V> p = getParent(n);

        // link children tree in place of node
        if (childTree == null) {
            // no children, just unlink from parent
            if (p.o_c == n) {
                if (n.y_s == p) {
                    p.o_c = null;
                } else {
                    p.o_c = n.y_s;
                }
            } else {
                p.o_c.y_s = p;
            }
        } else {
            // link children tree to parent
            if (p.o_c == n) {
                childTree.y_s = n.y_s;
                p.o_c = childTree;
            } else {
                p.o_c.y_s = childTree;
                childTree.y_s = p;
            }
        }

        size--;
        n.o_c = null;
        n.y_s = null;
    }
319798
public function removeAssoc(NodeInterface $node, array $mapping)
    {
        if ($node->hasProperty($mapping['assoc'])) {
            $node->getProperty($mapping['assoc'])->remove();
        }
        if ($node->hasProperty($mapping['assocNulls'])) {
            $node->getProperty($mapping['assocNulls'])->remove();
        }
    }
1128396
protected function moveNodeToDestinationPath(NodeInterface $node, $destinationPath)
    {
        $nodeData = $node->getNodeData();
        $possibleShadowedNodeData = $nodeData->move($destinationPath, $this->context->getWorkspace());
        if ($node instanceof Node) {
            $node->setNodeData($possibleShadowedNodeData);
        }
    }
1148998
public function deleteNode($node)
    {
        $target_pos = $node->getPosition();
        $this->rewind();
        $pos = 0;

        // Omit target node and adjust pos of remainder
        $done = false;
        try {
            while ($n = $this->current()) {
                if ($pos == $target_pos && !$done) {
                    $done = true;
                    $this->next();
                    $this->offsetUnset($pos);
                } elseif ($pos >= $target_pos) {
                    $n->setPosition($pos);
                    $pos++;
                    $this->next();
                } else {
                    $pos++;
                    $this->next();
                }
            }
        }
        catch (Exception $e) {
            // no-op - shift() throws an exception, sigh
        }

    }