public function getDescendantNodes(callable $shouldDescendIntoChildrenFn = null) {
        foreach ($this->getChildNodes() as $child) {
            yield $child;
            if ($shouldDescendIntoChildrenFn === null || $shouldDescendIntoChildrenFn($child)) {
                yield from $child->getDescendantNodes($shouldDescendIntoChildrenFn);
            }
        }
    }
public function getDescendantNodes(callable $shouldDescendIntoChildrenFn = null) {
        foreach ($this->getChildNodes() as $child) {
            yield $child;
            if ($shouldDescendIntoChildrenFn === null || $shouldDescendIntoChildrenFn($child)) {
                yield from $child->getDescendantNodes($shouldDescendIntoChildrenFn);
            }
        }
    }
public function getDescendantNodes ( callable $ shouldDescendIntoChildrenFn = null ) { foreach ( $ this -> getChildNodes ( ) as $ child ) { yield $ child ; if ( $ shouldDescendIntoChildrenFn === null || $ shouldDescendIntoChildrenFn ( $ child ) ) { yield from $ child -> getDescendantNodes ( $ shouldDescendIntoChildrenFn ) ; } } }
Gets a generator containing all descendant Nodes.
@param callable|null $shouldDescendIntoChildrenFn
@return \Generator|Node[]
Gets a generator containing all descendant Nodes .