nikic/PHP-Parser — pull request #74 by cspray (2013-09-20 12:46:46+00:00)
Title: Feature request and implementation for NodeTraverser::removeVisitor

This pull request adds a test and implementation for removing an added `PHPParser_NodeVisitor` to a `PHPParser_NodeTraverser`. You pass a `NodeVisitor` as the first argument to the method and any added visitors strictly (`===`) matching that object will be removed. A side effect of this is that the visitors array's indices may become unordered but this doesn't appear to be a problem as I didn't see anyplace where you were relying on that.

I realize this alters an interface and might not be quickly merged in but I think it provides some useful functionality and allows better control over what visitors a traverser will wind up invoking.