Skip to content

Commit

Permalink
Reverted return types from ConnectingVisitor classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgsowa committed May 28, 2024
1 parent 7ec0429 commit e3b67c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ final class NodeConnectingVisitor extends NodeVisitorAbstract {
*/
private $previous;

public function beforeTraverse(array $nodes): void {
public function beforeTraverse(array $nodes) {
$this->stack = [];
$this->previous = null;
}

public function enterNode(Node $node): void {
public function enterNode(Node $node) {
if (!empty($this->stack)) {
$node->setAttribute('parent', $this->stack[count($this->stack) - 1]);
}
Expand All @@ -43,7 +43,7 @@ public function enterNode(Node $node): void {
$this->stack[] = $node;
}

public function leaveNode(Node $node): void {
public function leaveNode(Node $node) {
$this->previous = $node;

array_pop($this->stack);
Expand Down
6 changes: 3 additions & 3 deletions lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ final class ParentConnectingVisitor extends NodeVisitorAbstract {
*/
private array $stack = [];

public function beforeTraverse(array $nodes): void {
public function beforeTraverse(array $nodes) {
$this->stack = [];
}

public function enterNode(Node $node): void {
public function enterNode(Node $node) {
if (!empty($this->stack)) {
$node->setAttribute('parent', $this->stack[count($this->stack) - 1]);
}

$this->stack[] = $node;
}

public function leaveNode(Node $node): void {
public function leaveNode(Node $node) {
array_pop($this->stack);
}
}

0 comments on commit e3b67c0

Please sign in to comment.