Php_codesniffer: Feature suggestion: sniff to discourage/forbid use of `goto` language construct

Created on 19 Sep 2017  路  2Comments  路  Source: squizlabs/PHP_CodeSniffer

Usage of goto is often seen as a typical code smell.

AFAICS there is currently no sniff to detect usage of goto and discourage/forbid it.

Is there any interest for a Generic.PHP.DiscourageGoto sniff to detect this ? I'd be happy to create a PR for this.

Enhancement

Most helpful comment

There is no sniff that I know of. Seems like a good idea, and happy to accept a PR for it.

All 2 comments

There is no sniff that I know of. Seems like a good idea, and happy to accept a PR for it.

Sniff created, see PR #1664

Was this page helpful?
0 / 5 - 0 ratings