/** * @param Path $source original file * @param Path $target new file */ public function createLink(Path $source, Path $target) { $this->fs->symlink($source->getValue(), $target->getValue(), true); }
/** * @param Observable $observable of FileWithDate * @param Path $targetPath * @return Observable */ public function createSymlinkCommands(Observable $observable, Path $targetPath) { return $observable->map(function (FileWithDate $file) use($targetPath) { return SymlinkCommand::from($file->getFile()->getRealPath(), "{$targetPath->getValue()}/{$file->getSymlinkTarget()}"); }); }