original_string: public function move($pathname)
      {
          if (!empty($pathname)) {
              if ($pathname instanceof \SplFileInfo) {
                  $targetFile = $pathname;
              } else {
                  $targetFile = new File($pathname);
              }
  
              if ($this->exists()) {
                  if ($targetFile->isDir()) {
                      $targetPathname = $targetFile->getPathname() . self::PATH_SEPARATOR . $this->getBasename();
                      if (rename($this->getPathname(), $targetPathname)) {
                          parent::__construct($targetPathname);
                          return true;
                      }
                  } else {
                      throw new FileException('Move failed, target directory do not exist.');
                  }
              } else {
                  throw new FileException('Move failed, source file or directory do not exist.');
              }
          } else {
              throw new FileException('Move failed, because given filepath is empty.');
          }
          return false;
      }
code: public function move($pathname)
      {
          if (!empty($pathname)) {
              if ($pathname instanceof \SplFileInfo) {
                  $targetFile = $pathname;
              } else {
                  $targetFile = new File($pathname);
              }
  
              if ($this->exists()) {
                  if ($targetFile->isDir()) {
                      $targetPathname = $targetFile->getPathname() . self::PATH_SEPARATOR . $this->getBasename();
                      if (rename($this->getPathname(), $targetPathname)) {
                          parent::__construct($targetPathname);
                          return true;
                      }
                  } else {
                      throw new FileException('Move failed, target directory do not exist.');
                  }
              } else {
                  throw new FileException('Move failed, source file or directory do not exist.');
              }
          } else {
              throw new FileException('Move failed, because given filepath is empty.');
          }
          return false;
      }
code_tokens: public function move ( $ pathname ) { if ( ! empty ( $ pathname ) ) { if ( $ pathname instanceof \ SplFileInfo ) { $ targetFile = $ pathname ; } else { $ targetFile = new File ( $ pathname ) ; } if ( $ this -> exists ( ) ) { if ( $ targetFile -> isDir ( ) ) { $ targetPathname = $ targetFile -> getPathname ( ) . self :: PATH_SEPARATOR . $ this -> getBasename ( ) ; if ( rename ( $ this -> getPathname ( ) , $ targetPathname ) ) { parent :: __construct ( $ targetPathname ) ; return true ; } } else { throw new FileException ( 'Move failed, target directory do not exist.' ) ; } } else { throw new FileException ( 'Move failed, source file or directory do not exist.' ) ; } } else { throw new FileException ( 'Move failed, because given filepath is empty.' ) ; } return false ; }
docstring: move file to a given directory
  
  @param       \SplFileInfo|string        $pathname
  @return      bool
  @throws      FileException
docstring_tokens: move file to a given directory