public function getDescendantTokens(callable $shouldDescendIntoChildrenFn = null) {
        foreach ($this->getChildNodesAndTokens() as $child) {
            if ($child instanceof Node) {
                if ($shouldDescendIntoChildrenFn == null || $shouldDescendIntoChildrenFn($child)) {
                    yield from $child->getDescendantTokens($shouldDescendIntoChildrenFn);
                }
            } elseif ($child instanceof Token) {
                yield $child;
            }
        }
    }
public function getDescendantTokens(callable $shouldDescendIntoChildrenFn = null) {
        foreach ($this->getChildNodesAndTokens() as $child) {
            if ($child instanceof Node) {
                if ($shouldDescendIntoChildrenFn == null || $shouldDescendIntoChildrenFn($child)) {
                    yield from $child->getDescendantTokens($shouldDescendIntoChildrenFn);
                }
            } elseif ($child instanceof Token) {
                yield $child;
            }
        }
    }
public function getDescendantTokens ( callable $ shouldDescendIntoChildrenFn = null ) { foreach ( $ this -> getChildNodesAndTokens ( ) as $ child ) { if ( $ child instanceof Node ) { if ( $ shouldDescendIntoChildrenFn == null || $ shouldDescendIntoChildrenFn ( $ child ) ) { yield from $ child -> getDescendantTokens ( $ shouldDescendIntoChildrenFn ) ; } } elseif ( $ child instanceof Token ) { yield $ child ; } } }
Gets generator containing all descendant Tokens.
@param callable|null $shouldDescendIntoChildrenFn
@return \Generator|Token[]
Gets generator containing all descendant Tokens .