protected function getDefects(array $defects, $type)
{
$count = sizeof($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 <= sizeof($defects); $i++) {
$output .= sprintf("\n%d) %s\n", $i, $defects[$i - 1]);
}
return $output;
}