Apply any offset to variable.
@param Node $var
@return Node
333969
private function offsetVariable(Node $var) {
    if ($this->currentType === '{') {
      $node = new ArrayLookupNode();
      $node->addChild($var, 'array');
      $this->mustMatch('{', $node);
      $node->addChild($this->expr(), 'key');
      $this->mustMatch('}', $node, NULL, TRUE);
      return $this->offsetVariable($node);
    }
    elseif ($this->currentType === '[') {
      $node = new ArrayLookupNode();
      $node->addChild($var, 'array');
      $this->dimOffset($node);
      return $this->offsetVariable($node);
    }
    else {
      return $var;
    }
  }
352424
public function set($variable, $value = null)
    {
        $this->variables[$variable] = array(
            'safe' => $this->htmlEncode($value),
            'unsafe' => $value
        );

        return $this;
    }
132279
public function setSink($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogSink::class);
        $this->sink = $var;

        return $this;
    }
860767
private function _compoundVariable() {
    $node = new CompoundVariableNode();
    $this->mustMatch('$', $node);
    $this->mustMatch('{', $node);
    $node->addChild($this->expr(), 'expression');
    $this->mustMatch('}', $node, NULL, TRUE);
    return $node;
  }
777606
public function setSuffixes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->suffixes = $arr;

        return $this;
    }
479494
public function setPlacement($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\JobPlacement::class);
        $this->placement = $var;

        return $this;
    }
1247601
public function setExtensionRange($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class);
        $this->extension_range = $arr;
        $this->has_extension_range = true;

        return $this;
    }
543690
public function overwrite($var = true)
    {
        switch ($var) 
        {
            case true:
                array_push($this->parameters, '-y');
                return $this;
                break;

            case false:
                array_push($this->parameters, '-n');
                return $this;
                break;

            default:
                return false;
                break;
        }
    }
394957
public function addRawVariable(Variable $variable)
    {
        if (!isset($this->branchVariables[1])) {
            $this->branchVariables[1] = [];
        }
        $this->branchVariables[1][$variable->getName()] = $variable;

        return $variable;
    }
1027753
public function get($var)
    {
        $node = $this->mainNode->getByKey($var);
        if (empty($node)) return null;

        return $node->getData();
    }
1175605
public function setExtension($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
        $this->extension = $arr;
        $this->has_extension = true;

        return $this;
    }
132633
public function setLabel($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Language\V1\DependencyEdge_Label::class);
        $this->label = $var;

        return $this;
    }
328591
public function template($var = null)
    {
        if ($var !== null) {
            $this->template = $var;
        }
        if (empty($this->template)) {
            $this->template = ($this->modular() ? 'modular/' : '') . str_replace($this->extension(), '', $this->name());
        }

        return $this->template;
    }
30710
public function setDirection($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery_Direction::class);
        $this->direction = $var;

        return $this;
    }
1079198
public function get(string $var)
    {
        if (!$this->mainNode) {
            return null;
        }

        $node = $this->mainNode->getLastByKey($var);
        if ($node === null) {
            return null;
        }

        return $node->getData();
    }
8960
public function setOp($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter_Operator::class);
        $this->op = $var;

        return $this;
    }
614096
public function setLatLongRect($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\LatLongRect::class);
        $this->lat_long_rect = $var;

        return $this;
    }