vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.54k stars 660 forks source link

Psalm\Suppress annotations #11054

Open vasily-kartashov opened 1 month ago

vasily-kartashov commented 1 month ago

Would it be possible to add support for attributes like

 #[Psalm\Suppress(Psalm::MixedReturnStatement, Psalm::MixedReturnType)]
 public function ....

At the moment it's all PHPDoc, which is ugly, longer than needs to be, not safe (e.g.@opsalm-suppress MixedReturnStatment), etc. The attributes don't have the granularity of PHPDocs, but that's about the only negative thing I can think of.

psalm-github-bot[bot] commented 1 month ago

Hey @vasily-kartashov, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.