protected function writeToFile(OutputInterface $output, SplFileInfo $originalFile, $newConfig, $newFormat)
    {
        $proposedLocation = $originalFile->getPath().'/services.'.$newFormat;
        $location = $this->getHelperSet()->get('dialog')->ask(
            $output,
            "<info>Where should the new config be written?</info> [{$proposedLocation}] ",
            $proposedLocation
        );

        if (file_exists($location)
            && !$this->getHelperSet()->get('dialog')->askConfirmation($output, 'File exists. Overwrite? ')
        ) {
            $output->writeln('Aborting...');

            return;
        }

        file_put_contents($location, $newConfig);
        $output->writeln(
            "Written! Don't forget to update the DependencyInjection/*Extension class in your bundle to use the new ".
            "loader class and delete the old config file."
        );
    }