code: public function setToDirectoryFromFile($file)
      {
          $fileDir = $this->getFilePath($file);
  
          $this->setToDirectory($fileDir);
  
          return $this;
      }
docs: inspect file directory and set it
  
  @param $file
  @return $this