public function apply($testable, array $config = array())
{
extract($config += $this->config);
foreach ($testable->lines() as $i => $line) {
$tabBounty = substr_count($line, "\t") * ($tabWidth - 1);
$strlen = Multibyte::strlen($line, array('name' => 'li3_quality'));
$totalLength = $length = $tabBounty + $strlen;
if ($totalLength > $hardLimit) {
$this->addViolation(array('message' => "Maximum line length of {$hardLimit} exceeded", 'line' => $i + 1, 'position' => $length));
} elseif ($softLimit && $totalLength > $softLimit) {
$this->addWarning(array('message' => "Soft line length of {$softLimit} exceeded", 'line' => $i + 1, 'position' => $length));
}
}
}