protected function processJunks(array $chunk): int
    {
        $processed = 0;

        while (!empty($chunk)) {
            $processed++;
            $file = array_shift($chunk);

            list($errors, $warnings) = $this->processFile($file);

            if ($this->format !== 'json') {
                $this->printLegend($errors, $warnings);
            }
        }

        return $processed;
    }