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);
    }