protected function displayText(array $details, bool $verbose = false): int
    {
        $errors = 0;

        foreach ($details as $info) {
            if ($verbose && $info['valid']) {
                $file = ' in ' . $info['file'];
                $this->line('<info>OK</info>' . $file);
            } elseif (! $info['valid']) {
                $errors++;
                $this->renderException($info);
            }
        }

        if ($errors === 0) {
            $this->comment(\sprintf('All %d Twig files contain valid syntax.', \count($details)));
        } else {
            $this->warn(\sprintf('%d Twig files have valid syntax and %d contain errors.', \count($details) - $errors, $errors));
        }

        return \min($errors, 1);
    }