Skip to content

Commit

Permalink
Stub errors cannot be ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 31, 2022
1 parent d96e8f0 commit a1abfc3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/Analyser/Error.php
Expand Up @@ -137,6 +137,25 @@ public function withoutTip(): self
);
}

public function doNotIgnore(): self
{
if (!$this->canBeIgnored()) {
return $this;
}

return new self(
$this->message,
$this->file,
$this->line,
false,
$this->filePath,
$this->traitFilePath,
$this->tip,
$this->nodeLine,
$this->nodeType,
);
}

public function getNodeLine(): ?int
{
return $this->nodeLine;
Expand Down
2 changes: 1 addition & 1 deletion src/PhpDoc/StubValidator.php
Expand Up @@ -106,7 +106,7 @@ static function (): void {
},
)->getErrors();
foreach ($tmpErrors as $tmpError) {
$errors[] = $tmpError->withoutTip();
$errors[] = $tmpError->withoutTip()->doNotIgnore();
}
} catch (Throwable $e) {
if ($debug) {
Expand Down

0 comments on commit a1abfc3

Please sign in to comment.