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."
        );
    }
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."
        );
    }
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." ) ; }
Write the new config to the same directory as the original file

@param OutputInterface $output
@param SplFileInfo     $originalFile
@param string          $newConfig
@param string          $newFormat    The short file name given, like
Write the new config to the same directory as the original file