map() public method

Takes a transforming function that operates on each element.
public map ( callable $selector ) : Rx\Observable\AnonymousObservable
$selector callable
return Rx\Observable\AnonymousObservable
 /**
  * @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()}");
     });
 }