src/PHPFormatter/Command/PHPFormatterCommand.php
protected function fixFiles(
        InputInterface $input,
        OutputInterface $output,
        Finder $files,
        FixerInterface $fixer
    ) {
        $verbose = $output->getVerbosity();

        /*
         * Each found php file is processed
         */
        foreach ($files as $file) {
            $data = $file->getContents();
            $result = $fixer->fix($data);

            if ($result === false || $data === $result) {
                continue;
            }

            if ($verbose >= OutputInterface::VERBOSITY_NORMAL) {
                $output->writeln('# ' . $file);
            }

            if (!$input->getOption('dry-run')) {
                file_put_contents($file->getRealPath(), $result);
            }
        }
    }
protected function fixFiles(
        InputInterface $input,
        OutputInterface $output,
        Finder $files,
        FixerInterface $fixer
    ) {
        $verbose = $output->getVerbosity();

        /*
         * Each found php file is processed
         */
        foreach ($files as $file) {
            $data = $file->getContents();
            $result = $fixer->fix($data);

            if ($result === false || $data === $result) {
                continue;
            }

            if ($verbose >= OutputInterface::VERBOSITY_NORMAL) {
                $output->writeln('# ' . $file);
            }

            if (!$input->getOption('dry-run')) {
                file_put_contents($file->getRealPath(), $result);
            }
        }
    }
protected function fixFiles ( InputInterface $ input , OutputInterface $ output , Finder $ files , FixerInterface $ fixer ) { $ verbose = $ output -> getVerbosity ( ) ; /*
         * Each found php file is processed
         */ foreach ( $ files as $ file ) { $ data = $ file -> getContents ( ) ; $ result = $ fixer -> fix ( $ data ) ; if ( $ result === false || $ data === $ result ) { continue ; } if ( $ verbose >= OutputInterface :: VERBOSITY_NORMAL ) { $ output -> writeln ( '# ' . $ file ) ; } if ( ! $ input -> getOption ( 'dry-run' ) ) { file_put_contents ( $ file -> getRealPath ( ) , $ result ) ; } } }
Fix files with given fixer.

@param InputInterface  $input
@param OutputInterface $output
@param Finder          $files
@param FixerInterface  $fixer
Fix files with given fixer .