Alexia / php7mar

PHP 7 Migration Assistant Report (MAR)
GNU General Public License v3.0
797 stars 133 forks source link

Add option to suppress potential issues on a line level basis #34

Open TysonAndre opened 7 years ago

TysonAndre commented 7 years ago

This may be useful on large codebases, to track issues that were investigated and found to be false positives (especially if changes will be made later before running php7mar again, and one wants to know which issues were already investigated)

Proposed syntax:

Add a comment with @suppress php7mar-<issue type> [optional description] anywhere in the line where the issue would be emitted.

Example:

foreach ($foo as &$value) { // @suppress php7mar-syntax (nothing else is iterating over this array)

(Without this proposed suppression, php7mar would emit a syntax error in the report warning about changed behavior of foreach by reference)