Fixed TechnicalDebt plugin. Issue #82.
This commit is contained in:
parent
fd0903302d
commit
97be2fb4f1
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue