public function writeToFile(Crontab $crontab, $filename)
    {
        if (!is_writable($filename)) {
            throw new \InvalidArgumentException('File '.$filename.' is not writable.');
        }

        file_put_contents($filename, $crontab->render().PHP_EOL);

        return $this;
    }
public function writeToFile(Crontab $crontab, $filename)
    {
        if (!is_writable($filename)) {
            throw new \InvalidArgumentException('File '.$filename.' is not writable.');
        }

        file_put_contents($filename, $crontab->render().PHP_EOL);

        return $this;
    }
public function writeToFile ( Crontab $ crontab , $ filename ) { if ( ! is_writable ( $ filename ) ) { throw new \ InvalidArgumentException ( 'File ' . $ filename . ' is not writable.' ) ; } file_put_contents ( $ filename , $ crontab -> render ( ) . PHP_EOL ) ; return $ this ; }
Write the current crons to a file.

@param Crontab $crontab
@param string  $filename

@return CrontabFileHandler
@throws \InvalidArgumentException
Write the current crons to a file .