original_string: private function getFields($tokens, $namingConvention, $class)
      {
          $fields = [];
          $prefix = '';
  
          foreach ($tokens->getTokens() as $token) {
              if ($token instanceof ByToken) {
                  return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
              }
  
              if ($token instanceof AllToken) {
                  return $prefix . $this->fieldsToSQL([], $class, $namingConvention);
              }
  
              if($token instanceof DistinctToken) {
                  $prefix .= 'DISTINCT ';
                  continue;
              }
  
              if ($token instanceof AndToken) {
                  // Ignore and tokens as they do nothing
                  continue;
              }
  
              if (!($token instanceof ValueToken)) {
                  throw new DslSyntaxException('Unexpected token ' . $token->getName() . ' in field selector', DATADO_UNEXPECTED_TOKEN);
              }
  
              $fields[] = lcfirst($token->getSource());
          }
  
          return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
      }
code: private function getFields($tokens, $namingConvention, $class)
      {
          $fields = [];
          $prefix = '';
  
          foreach ($tokens->getTokens() as $token) {
              if ($token instanceof ByToken) {
                  return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
              }
  
              if ($token instanceof AllToken) {
                  return $prefix . $this->fieldsToSQL([], $class, $namingConvention);
              }
  
              if($token instanceof DistinctToken) {
                  $prefix .= 'DISTINCT ';
                  continue;
              }
  
              if ($token instanceof AndToken) {
                  // Ignore and tokens as they do nothing
                  continue;
              }
  
              if (!($token instanceof ValueToken)) {
                  throw new DslSyntaxException('Unexpected token ' . $token->getName() . ' in field selector', DATADO_UNEXPECTED_TOKEN);
              }
  
              $fields[] = lcfirst($token->getSource());
          }
  
          return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
      }
code_tokens: private function getFields ( $ tokens , $ namingConvention , $ class ) { $ fields = [ ] ; $ prefix = '' ; foreach ( $ tokens -> getTokens ( ) as $ token ) { if ( $ token instanceof ByToken ) { return $ prefix . $ this -> fieldsToSQL ( $ fields , $ class , $ namingConvention ) ; } if ( $ token instanceof AllToken ) { return $ prefix . $ this -> fieldsToSQL ( [ ] , $ class , $ namingConvention ) ; } if ( $ token instanceof DistinctToken ) { $ prefix .= 'DISTINCT ' ; continue ; } if ( $ token instanceof AndToken ) { // Ignore and tokens as they do nothing continue ; } if ( ! ( $ token instanceof ValueToken ) ) { throw new DslSyntaxException ( 'Unexpected token ' . $ token -> getName ( ) . ' in field selector' , DATADO_UNEXPECTED_TOKEN ) ; } $ fields [ ] = lcfirst ( $ token -> getSource ( ) ) ; } return $ prefix . $ this -> fieldsToSQL ( $ fields , $ class , $ namingConvention ) ; }
docstring: Build the SQL string for the fields from a MethodNameToken
  @param MethodNameToken $tokens
  @param NamingConvention $namingConvention
  @param ReflectionClass $class
  @return string
  @throws DslSyntaxException if an unexpected token is found
docstring_tokens: Build the SQL string for the fields from a MethodNameToken