diff --git a/src/Analyser/Error.php b/src/Analyser/Error.php index 9c45d72cb1..f36ba89284 100644 --- a/src/Analyser/Error.php +++ b/src/Analyser/Error.php @@ -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; diff --git a/src/PhpDoc/StubValidator.php b/src/PhpDoc/StubValidator.php index acb00651eb..5bbf713a50 100644 --- a/src/PhpDoc/StubValidator.php +++ b/src/PhpDoc/StubValidator.php @@ -106,7 +106,7 @@ static function (): void { }, )->getErrors(); foreach ($tmpErrors as $tmpError) { - $errors[] = $tmpError->withoutTip(); + $errors[] = $tmpError->withoutTip()->doNotIgnore(); } } catch (Throwable $e) { if ($debug) {