Skip to content

Commit

Permalink
Code highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhanyumer authored and nikic committed Oct 31, 2021
1 parent 7064539 commit 6a21234
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/component/Walking_the_AST.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ anonymous classes), you know that once you've seen a class declaration, there is
checking all it's child nodes, because PHP does not allow nesting classes. In this case, you can
instruct the traverser to not recurse into the class node:

```
```php
private $classes = [];
public function enterNode(Node $node) {
if ($node instanceof Node\Stmt\Class_) {
Expand All @@ -211,7 +211,7 @@ after finding it. For example, if you are looking for the node of a class with a
discounting exotic cases like conditionally defining a class two times), you can stop traversal
once you found it:

```
```php
private $class = null;
public function enterNode(Node $node) {
if ($node instanceof Node\Stmt\Class_ &&
Expand Down Expand Up @@ -251,7 +251,7 @@ Stmt_Return(

the following method calls will be performed:

```
```php
$visitorA->enterNode(Stmt_Return)
$visitorB->enterNode(Stmt_Return)
$visitorA->enterNode(Expr_Variable)
Expand Down

0 comments on commit 6a21234

Please sign in to comment.