protected function getDefects(array $defects, string $type): string
    {
        $count = \count($defects);
        if ($count === 0) {
            return '';
        }
        $output = sprintf(
            "There %s %d %s%s:\n",
            ($count === 1) ? 'was' : 'were',
            $count,
            $type,
            ($count === 1) ? '' : 's'
        );

        for ($i = 1; $i <= \count($defects); ++$i) {
            $output .= sprintf("\n%d) %s\n", $i, $defects[$i - 1]);
        }

        return $output;
    }