original_string: private function getToken($token, &$hasSeenBy)
      {
          switch ($token) {
              case 'And':
                  return new AndToken();
              case 'Or':
                  return new OrToken();
              case 'By':
              case 'Where':
                  $hasSeenBy = true;
                  return new ByToken();
              case 'All':
                  return new AllToken();
              case 'Distinct':
                  if ($hasSeenBy) {
                      return new ValueToken($token);
                  } else {
                      return new DistinctToken();
                  }
              case 'Like':
                  if ($hasSeenBy) {
                      return new LikeToken();
                  } else {
                      return new ValueToken($token);
                  }
              default:
                  return new ValueToken($token);
          }
      }
code: private function getToken($token, &$hasSeenBy)
      {
          switch ($token) {
              case 'And':
                  return new AndToken();
              case 'Or':
                  return new OrToken();
              case 'By':
              case 'Where':
                  $hasSeenBy = true;
                  return new ByToken();
              case 'All':
                  return new AllToken();
              case 'Distinct':
                  if ($hasSeenBy) {
                      return new ValueToken($token);
                  } else {
                      return new DistinctToken();
                  }
              case 'Like':
                  if ($hasSeenBy) {
                      return new LikeToken();
                  } else {
                      return new ValueToken($token);
                  }
              default:
                  return new ValueToken($token);
          }
      }
code_tokens: private function getToken ( $ token , & $ hasSeenBy ) { switch ( $ token ) { case 'And' : return new AndToken ( ) ; case 'Or' : return new OrToken ( ) ; case 'By' : case 'Where' : $ hasSeenBy = true ; return new ByToken ( ) ; case 'All' : return new AllToken ( ) ; case 'Distinct' : if ( $ hasSeenBy ) { return new ValueToken ( $ token ) ; } else { return new DistinctToken ( ) ; } case 'Like' : if ( $ hasSeenBy ) { return new LikeToken ( ) ; } else { return new ValueToken ( $ token ) ; } default : return new ValueToken ( $ token ) ; } }
docstring: Translate a token source to a token object.
  @param $token string the token source
  @return Token the token object
docstring_tokens: Translate a token source to a token object .