public function lintFile($file, OutputInterface $output)
    {
        $manager  = new Manager();
        $settings = new Settings();
        $settings->addPaths([$file]);

        ob_start();
        $result = $manager->run($settings);
        $buffer = ob_get_contents();
        ob_end_clean();

        if ($result->hasError()) {
            $output->writeln('<error>Syntax error was found in config.php after it was updated.</error>');
            $output->writeln(['<error>Review the PHP Lint report for more details:</error>', '', $buffer]);
        }

        return $result->hasError() ? 1 : 0;
    }
public function lintFile($file, OutputInterface $output)
    {
        $manager  = new Manager();
        $settings = new Settings();
        $settings->addPaths([$file]);

        ob_start();
        $result = $manager->run($settings);
        $buffer = ob_get_contents();
        ob_end_clean();

        if ($result->hasError()) {
            $output->writeln('<error>Syntax error was found in config.php after it was updated.</error>');
            $output->writeln(['<error>Review the PHP Lint report for more details:</error>', '', $buffer]);
        }

        return $result->hasError() ? 1 : 0;
    }
public function lintFile ( $ file , OutputInterface $ output ) { $ manager = new Manager ( ) ; $ settings = new Settings ( ) ; $ settings -> addPaths ( [ $ file ] ) ; ob_start ( ) ; $ result = $ manager -> run ( $ settings ) ; $ buffer = ob_get_contents ( ) ; ob_end_clean ( ) ; if ( $ result -> hasError ( ) ) { $ output -> writeln ( '<error>Syntax error was found in config.php after it was updated.</error>' ) ; $ output -> writeln ( [ '<error>Review the PHP Lint report for more details:</error>' , '' , $ buffer ] ) ; } return $ result -> hasError ( ) ? 1 : 0 ; }
Check a single file for PHP syntax errors.

@param string          $file   Path to the file to lint
@param OutputInterface $output

@return int
Check a single file for PHP syntax errors .