private function traverseVariable(\PHPParser_Node_Expr_Variable $node, LinkedFlowScope $scope) { if ('this' === $node->name) { if (null === $scope->getTypeOfThis()) { $node->setAttribute('type', $this->typeRegistry->getNativeType('none')); return $scope; } $node->setAttribute('type', $this->typeRegistry->getThisType($scope->getTypeOfThis())); return $scope; } if (is_string($node->name)) { $slot = $scope->getSlot($node->name); if ($slot && ($type = $slot->getType())) { $node->setAttribute('type', $type); } } else { $scope = $this->traverseChildren($node, $scope); } return $scope; }