original_string: public function getUnique($alias)
      {
          if (!$this->exists($alias)) {
              return $alias;
          }
  
          $info = pathinfo($alias);
          $ext = isset($info['extension']) ? '.' . $info['extension'] : '';
  
          $counter = 0;
  
          do {
              $counter++;
              $modified = $info['filename'] . '-' . $counter . $ext;
          } while ($this->exists($modified));
  
          return $modified;
      }
code: public function getUnique($alias)
      {
          if (!$this->exists($alias)) {
              return $alias;
          }
  
          $info = pathinfo($alias);
          $ext = isset($info['extension']) ? '.' . $info['extension'] : '';
  
          $counter = 0;
  
          do {
              $counter++;
              $modified = $info['filename'] . '-' . $counter . $ext;
          } while ($this->exists($modified));
  
          return $modified;
      }
code_tokens: public function getUnique ( $ alias ) { if ( ! $ this -> exists ( $ alias ) ) { return $ alias ; } $ info = pathinfo ( $ alias ) ; $ ext = isset ( $ info [ 'extension' ] ) ? '.' . $ info [ 'extension' ] : '' ; $ counter = 0 ; do { $ counter ++ ; $ modified = $ info [ 'filename' ] . '-' . $ counter . $ ext ; } while ( $ this -> exists ( $ modified ) ) ; return $ modified ; }
docstring: Returns a unique alias using a base string
  @param string $alias
  @return string
docstring_tokens: Returns a unique alias using a base string