Fixed TechnicalDebt plugin. Issue #82.

This commit is contained in:
Dmitry Khomutov 2017-12-08 20:34:35 +07:00
parent fd0903302d
commit 97be2fb4f1
No known key found for this signature in database
GPG key ID: EC19426474B37AAC

View file

@ -175,26 +175,21 @@ class TechnicalDebt extends Plugin implements ZeroConfigPluginInterface
while (false === feof($handle)) {
$line = fgets($handle);
$technicalDeptLine = false;
foreach ($this->searches as $search) {
if ($technicalDeptLine = trim(strstr($line, $search))) {
break;
$fileName = str_replace($this->directory, '', $file);
$this->build->reportError(
$this->builder,
'technical_debt',
$technicalDeptLine,
PHPCensor\Model\BuildError::SEVERITY_LOW,
$fileName,
$lineNumber
);
}
}
if ($technicalDeptLine) {
$fileName = str_replace($this->directory, '', $file);
$this->build->reportError(
$this->builder,
'technical_debt',
$technicalDeptLine,
PHPCensor\Model\BuildError::SEVERITY_LOW,
$fileName,
$lineNumber
);
}
$lineNumber++;
}
fclose ($handle);