website/errors/ignore.unmatchedLine.md
<?php declare(strict_types = 1);
function doFoo(int $i): int
{
// @phpstan-ignore-next-line
return $i + 1;
}
A @phpstan-ignore-next-line or @phpstan-ignore-line comment is present, but no error is reported on that line. This means the ignore comment is unnecessary because the code on that line does not produce any PHPStan error.
This typically happens when:
This error is controlled by the reportUnmatchedIgnoredErrors configuration parameter.
Remove the unnecessary ignore comment:
<?php declare(strict_types = 1);
function doFoo(int $i): int
{
- // @phpstan-ignore-next-line
return $i + 1;
}
If the ignore comment was suppressing an error that still exists but has moved, relocate the comment to the correct line.