grom358 / pharborist

A PHP library to query and transform source code via tree operations.
GNU General Public License v3.0
44 stars 10 forks source link

Add a static negate() method to BooleanNotNode #146

Closed phenaproxima closed 10 years ago

phenaproxima commented 10 years ago

This method should take any node and return a BooleanNotNode representing the negated node:

// $node is, say, a method call -- like $foo->baz()
echo BooleanNotNode::negate($node); // !$foo-baz()

I will take a shot at this and probably give it a clearer name, like fromExpression().