/**
  * {@inheritDoc}
  */
 public function enterNode(Node $node)
 {
     if ($node instanceof Variable) {
         $this->foundVariableAccesses[] = VariableAccess::fromVariableAndOperation($node, ...$this->lastVisitedNodes);
     }
     if ($node instanceof Node\Stmt\StaticVar) {
         $this->foundVariableAccesses[] = VariableAccess::fromStaticVariableAndOperations($node, ...$this->lastVisitedNodes);
     }
     $this->lastVisitedNodes[] = $node;
 }
 /**
  * @dataProvider sideEffectCasesProvider
  */
 public function testChecksIfAccessCanCauseSideEffects(bool $mayCauseSideEffects, array $variableTypes, string $varName, Node ...$operations)
 {
     self::assertSame($mayCauseSideEffects, VariableAccess::fromVariableAndOperation(new Variable($varName), ...$operations)->canCauseSideEffects($variableTypes));
 }