Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. $source = visitNode($source, function($node){
  2. if($node instanceof Namespace_) return NULL;
  3. return NodeTraverser::DONT_TRAVERSE_CHILDREN;
  4. }, function($node){
  5. if($node instanceof Name) return NULL; // this is the name of Namespace_
  6. if($node instanceof Namespace_) return NULL;
  7. if($node instanceof Declare_) return NULL;
  8. if($node instanceof Use_) return NULL;
  9. if($node instanceof Class_) return NULL;
  10. if($node instanceof Interface_) return NULL;
  11. if($node instanceof Function_) return NULL;
  12. return NodeTraverser::REMOVE_NODE;
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement