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;
    }