scrutinizer-ci/scrutinizer

Deprecation notices without condition

chalasr opened this issue · 1 comments

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

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