Lines Matching refs:if
14 if ($node instanceof Node\Scalar\Int_) {
58 For example, if we have the following excerpt of an AST
107 if ($node instanceof Node\Scalar\LNumber) {
118 if ($node instanceof Node\Expr\BinaryOp\BooleanAnd) {
132 if ($node instanceof Node\Expr\BinaryOp\BooleanAnd) {
147 if ($node instanceof Node\Stmt\Return_) {
154 Node removal only works if the parent structure is an array. This means that usually it only makes
164 if ($node instanceof Node\Stmt\Expression
175 that `var_dump($a);` will be removed, but `if (var_dump($a))` will not be removed (and there is no
183 if ($node instanceof Node\Stmt\Else_) {
189 This is only safe to do if the subnode the node is stored in is nullable. `Node\Stmt\Else_` only
193 only works if the parent structure is an array.
197 if ($node instanceof Node\Stmt\Return_ && $node->expr !== null) {
212 especially if you have more than one visitor. In some cases, it is possible to avoid a full
223 if ($node instanceof Node\Stmt\Class_) {
234 after finding it. For example, if you are looking for the node of a class with a certain name (and
241 if ($node instanceof Node\Stmt\Class_ &&
265 It is important to understand that if a traverser is run with multiple visitors, the visitors will
341 // Find first class occurring in the AST. Returns null if no class exists.
359 reverse direction: When working on a node, you might want to check if the parent node satisfies a