src/Runner.php
public function run(Changeset $changeset)
    {
        $diff = new Diff($changeset->getDiff());

        if (!count($diff)) {
            return 0;
        }

        $reporter = new Reporter($diff, $this->config);

        $runner = new BaseRunner();
        $runner->config = $this->config;
        $runner->reporter = $reporter;
        $runner->init();

        $it = new Iterator($diff, $changeset, $runner->ruleset, $this->config);

        /** @var File $file */
        foreach ($it as $file) {
            $runner->processFile($file);
        }

        $reporter->printReports();

        return (int) ($reporter->totalErrors || $reporter->totalWarnings);
    }
public function run(Changeset $changeset)
    {
        $diff = new Diff($changeset->getDiff());

        if (!count($diff)) {
            return 0;
        }

        $reporter = new Reporter($diff, $this->config);

        $runner = new BaseRunner();
        $runner->config = $this->config;
        $runner->reporter = $reporter;
        $runner->init();

        $it = new Iterator($diff, $changeset, $runner->ruleset, $this->config);

        /** @var File $file */
        foreach ($it as $file) {
            $runner->processFile($file);
        }

        $reporter->printReports();

        return (int) ($reporter->totalErrors || $reporter->totalWarnings);
    }
public function run ( Changeset $ changeset ) { $ diff = new Diff ( $ changeset -> getDiff ( ) ) ; if ( ! count ( $ diff ) ) { return 0 ; } $ reporter = new Reporter ( $ diff , $ this -> config ) ; $ runner = new BaseRunner ( ) ; $ runner -> config = $ this -> config ; $ runner -> reporter = $ reporter ; $ runner -> init ( ) ; $ it = new Iterator ( $ diff , $ changeset , $ runner -> ruleset , $ this -> config ) ; /** @var File $file */ foreach ( $ it as $ file ) { $ runner -> processFile ( $ file ) ; } $ reporter -> printReports ( ) ; return ( int ) ( $ reporter -> totalErrors || $ reporter -> totalWarnings ) ; }
Runs CodeSniffer against specified changeset

@param Changeset $changeset Changeset instance

@return int
@throws DeepExitException
@throws Exception
Runs CodeSniffer against specified changeset