original_string: protected function saveFile($uploadedFile)
      {
          $ext = $this->getExt();
          $fullExt = $ext ? '.' . $ext : '';
  
          if ($this->fileName) {
              $fileName = $this->fileName;
          } else {
              $fileName = substr($uploadedFile['name'], 0, strlen($uploadedFile['name']) - strlen($fullExt));
          }
  
          $this->file = $this->dir . '/' . $fileName . $fullExt;
          if (!$this->overwrite) {
              $i = 1;
              while(is_file($this->file)) {
                  $this->file = $this->dir . '/' . $fileName . '-' . $i . $fullExt;
                  $i++;
              }
          }
  
          if (!$this->moveUploadedFile($uploadedFile['tmp_name'], $this->file)) {
              $this->addError('cantMove');
              return false;
          }
  
          return true;
      }
code: protected function saveFile($uploadedFile)
      {
          $ext = $this->getExt();
          $fullExt = $ext ? '.' . $ext : '';
  
          if ($this->fileName) {
              $fileName = $this->fileName;
          } else {
              $fileName = substr($uploadedFile['name'], 0, strlen($uploadedFile['name']) - strlen($fullExt));
          }
  
          $this->file = $this->dir . '/' . $fileName . $fullExt;
          if (!$this->overwrite) {
              $i = 1;
              while(is_file($this->file)) {
                  $this->file = $this->dir . '/' . $fileName . '-' . $i . $fullExt;
                  $i++;
              }
          }
  
          if (!$this->moveUploadedFile($uploadedFile['tmp_name'], $this->file)) {
              $this->addError('cantMove');
              return false;
          }
  
          return true;
      }
code_tokens: protected function saveFile ( $ uploadedFile ) { $ ext = $ this -> getExt ( ) ; $ fullExt = $ ext ? '.' . $ ext : '' ; if ( $ this -> fileName ) { $ fileName = $ this -> fileName ; } else { $ fileName = substr ( $ uploadedFile [ 'name' ] , 0 , strlen ( $ uploadedFile [ 'name' ] ) - strlen ( $ fullExt ) ) ; } $ this -> file = $ this -> dir . '/' . $ fileName . $ fullExt ; if ( ! $ this -> overwrite ) { $ i = 1 ; while ( is_file ( $ this -> file ) ) { $ this -> file = $ this -> dir . '/' . $ fileName . '-' . $ i . $ fullExt ; $ i ++ ; } } if ( ! $ this -> moveUploadedFile ( $ uploadedFile [ 'tmp_name' ] , $ this -> file ) ) { $ this -> addError ( 'cantMove' ) ; return false ; } return true ; }
docstring: Save uploaded file to upload directory
  
  @param array $uploadedFile
  @return boolean
docstring_tokens: Save uploaded file to upload directory