protected function file_open($file) { if ($this->filesystem->is_writable(dirname($file))) { $this->file_handle = fopen($file, 'w'); } else { throw new \RuntimeException('Unable to write to migrator log file'); } }