original_string: public function appendToQueryString(Request $request, $name, $value)
      {
          $queryString = '?';
          $query = $request->query->all();
          $query[$name] = $value;
          $parametersCount = count($query);
          $count = 1;
  
          foreach ($query as $parameterName => $parameterValue) {
              $queryString .= $parameterName . '=' . $parameterValue;
  
              if ($count != $parametersCount) {
                  $queryString .= '&';
              }
              $count++;
          }
          return $queryString;
      }
code: public function appendToQueryString(Request $request, $name, $value)
      {
          $queryString = '?';
          $query = $request->query->all();
          $query[$name] = $value;
          $parametersCount = count($query);
          $count = 1;
  
          foreach ($query as $parameterName => $parameterValue) {
              $queryString .= $parameterName . '=' . $parameterValue;
  
              if ($count != $parametersCount) {
                  $queryString .= '&';
              }
              $count++;
          }
          return $queryString;
      }
code_tokens: public function appendToQueryString ( Request $ request , $ name , $ value ) { $ queryString = '?' ; $ query = $ request -> query -> all ( ) ; $ query [ $ name ] = $ value ; $ parametersCount = count ( $ query ) ; $ count = 1 ; foreach ( $ query as $ parameterName => $ parameterValue ) { $ queryString .= $ parameterName . '=' . $ parameterValue ; if ( $ count != $ parametersCount ) { $ queryString .= '&' ; } $ count ++ ; } return $ queryString ; }
docstring: Append a named value in request query string
  
  @param Request $request
  @param $name
  @param $value
  @return string
docstring_tokens: Append a named value in request query string