The removeChild()
method removes a specified child node from the target node and returns the removed child node if successful.
The child node is completely removed from the target node's structure but is still available for further manipulation.
Description
public AbstractNode::removeChild(NodeInterface $node): ?NodeInterface
Parameters
node
The child node to be removed from the current node.
Return Value
Returns the removed node if successful, or null
if the node could not be removed.
Exceptions
NOT_FOUND_ERR
Thrown if the node is not a child of the target node.