/** * Save crons to file * * @param string $file /path/to/file/ */ public function save() { $crontabFile = $this->getCrontabFile(); if (!is_null($crontabFile)) { $this->crontabFileHandler->writeToFile($this->crontab, $crontabFile); } else { $this->crontabFileHandler->write($this->crontab); } return $this; }