scrutinizer-ci / scrutinizer

Legacy repository - archives past feature requests/bug reports
https://scrutinizer-ci.com/docs
140 stars 36 forks source link

Deprecation notices without condition #387

Closed chalasr closed 7 years ago

chalasr commented 7 years ago

Using trigger_error() out of any condition causes the following warning:

It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended

IMHO this issue should not occur for E_USER_DEPRECATED notices, as most deprecations do not need any condition.

Exemple code:

@trigger_error('...', E_USER_DEPRECATED); just below the namespace of a deprecated class, or as the first statement of the deprecated class constructor (the Symfony way for deprecating elements).

Could we do something for that? Thanks

chalasr commented 7 years ago

It seems like even wrapped into an if statement, the warning is triggered (as a bug + best practice).