original_string: protected function convertArgs($step)
      {
          if ($step instanceof Operator) {
              $arguments = $step->getArguments();
          } else {
              $arguments = $step;
          }
  
          if (is_array($arguments)) {
              $values = [];
              foreach ($arguments as $key => $args) {
                  if ($args instanceof Operator) {
                      if (is_string($key)) {
                          $values[$key] = [$this->cmd.$args->getOperatorName() => $this->convertArgs($args)];
                      } else {
                          $values[] = [$this->cmd.$args->getOperatorName() => $this->convertArgs($args)];
                      }
                  } else {
                      if (is_string($key)) {
                          $values[$key] = $this->convertArgs($args);
                      } else {
                          $values[] = $args;
                      }
                  }
              }
  
              return $values;
  
          } elseif ($arguments instanceof Operator) {
              return [$this->cmd.$arguments->getOperatorName() => $this->convertArgs($arguments)];
          } else {
              return $arguments;
          }
      }
code: protected function convertArgs($step)
      {
          if ($step instanceof Operator) {
              $arguments = $step->getArguments();
          } else {
              $arguments = $step;
          }
  
          if (is_array($arguments)) {
              $values = [];
              foreach ($arguments as $key => $args) {
                  if ($args instanceof Operator) {
                      if (is_string($key)) {
                          $values[$key] = [$this->cmd.$args->getOperatorName() => $this->convertArgs($args)];
                      } else {
                          $values[] = [$this->cmd.$args->getOperatorName() => $this->convertArgs($args)];
                      }
                  } else {
                      if (is_string($key)) {
                          $values[$key] = $this->convertArgs($args);
                      } else {
                          $values[] = $args;
                      }
                  }
              }
  
              return $values;
  
          } elseif ($arguments instanceof Operator) {
              return [$this->cmd.$arguments->getOperatorName() => $this->convertArgs($arguments)];
          } else {
              return $arguments;
          }
      }
code_tokens: protected function convertArgs ( $ step ) { if ( $ step instanceof Operator ) { $ arguments = $ step -> getArguments ( ) ; } else { $ arguments = $ step ; } if ( is_array ( $ arguments ) ) { $ values = [ ] ; foreach ( $ arguments as $ key => $ args ) { if ( $ args instanceof Operator ) { if ( is_string ( $ key ) ) { $ values [ $ key ] = [ $ this -> cmd . $ args -> getOperatorName ( ) => $ this -> convertArgs ( $ args ) ] ; } else { $ values [ ] = [ $ this -> cmd . $ args -> getOperatorName ( ) => $ this -> convertArgs ( $ args ) ] ; } } else { if ( is_string ( $ key ) ) { $ values [ $ key ] = $ this -> convertArgs ( $ args ) ; } else { $ values [ ] = $ args ; } } } return $ values ; } elseif ( $ arguments instanceof Operator ) { return [ $ this -> cmd . $ arguments -> getOperatorName ( ) => $ this -> convertArgs ( $ arguments ) ] ; } else { return $ arguments ; } }
docstring: Recursive convert args
  
  @todo refactor
  @param $step
  @return array|string
docstring_tokens: Recursive convert args