We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 824a23b commit fb9d320Copy full SHA for fb9d320
src/Analyser/FileAnalyser.php
@@ -205,12 +205,24 @@ public function analyseFile(
205
206
if ($this->reportUnmatchedIgnoredErrors) {
207
foreach (array_keys($unmatchedLineIgnores) as $line) {
208
+ $traitFilePath = null;
209
+ if ($scope->isInTrait()) {
210
+ $traitReflection = $scope->getTraitReflection();
211
+ if ($traitReflection->getFileName() !== false) {
212
+ $traitFilePath = $traitReflection->getFileName();
213
+ }
214
215
$fileErrors[] = new Error(
216
sprintf('No error to ignore is reported on line %d.', $line),
217
$scope->getFileDescription(),
218
$line,
219
false,
- $scope->getFile()
220
+ $scope->getFile(),
221
+ $traitFilePath,
222
+ null,
223
224
225
+ 'ignoredError.unmatchedOnLine'
226
);
227
}
228
0 commit comments