Disable/Suppress diagnostic for specific line? #2891
Replies: 2 comments 3 replies
-
|
Not currently no, but not sure that's a great idea as it introduces IDE specific annotations into a shared codebase that's agnostic of the IDE |
Beta Was this translation helpful? Give feedback.
-
|
I have the same issue. For such case it would be cool to suppress such warnings. Here is some code with the same behavior but different errors. Simple example: $currentSchedule = $accessPoint
->schedules()
->current($accessPoint->timezone)
->first();Expanded example: $currentSchedule = $accessPoint
->schedules()->where(
function (Builder $query) use ($accessPoint) {
$query->current($accessPoint->timezone);
}
)
->first(); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to suppress one of phpactor's built-in diagnostics, but only for a specific line?
there are times when phpactor will give a diagnostic for e.g. "worse.missing_member" because it doesn't understand the generic context like other analysis tools like psalm or PHPStan would, but I don't want to disable the diagnostic globally, just in the specific location.
E.g. how phpstan has
/** @phpstan-ignore <diagnostic name> */and psalm has/** @psalm-suppress <diagnostic name> */Beta Was this translation helpful? Give feedback.
All reactions