code: public function copyThenRemove($source, $target)
      {
          $this->copy($source, $target);
          if (!is_dir($source)) {
              $this->unlink($source);
  
              return;
          }
  
          $this->removeDirectoryPhp($source);
      }
docs: Copy then delete is a non-atomic version of {@link rename}.
  
  Some systems can't rename and also don't have proc_open,
  which requires this solution.
  
  @param string $source
  @param string $target