diff --git a/src/Analyser/Error.php b/src/Analyser/Error.php index 9af5f2b297..5d175a4176 100644 --- a/src/Analyser/Error.php +++ b/src/Analyser/Error.php @@ -45,6 +45,12 @@ public function __construct( if ($this->identifier !== null && !self::validateIdentifier($this->identifier)) { throw new ShouldNotHappenException(sprintf('Invalid identifier: %s', $this->identifier)); } + + if ($file !== $filePath) { + return; + } + + $this->filePath = null; } public function getMessage(): string