Generic.Functions.CallTimePassByReference deprecation notice with PHP_CodeSniffer 3.13.0
Using PHP_CodeSniffer 3.13.0 gives this warning:
- Generic.Functions.CallTimePassByReference
This sniff has been deprecated since v3.12.1 and will be removed in v4.0.0.
It looks like the functionality could be moved over to PHPCompatibility/PHPCompatibilityWP by using PHPCompatibility.Syntax.ForbiddenCallTimePassByReference.
More info here https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/921
@mikemanger Thanks for reporting this. We are aware of this, but to be honest, this is nothing to be concerned about.
Deprecation notices are advance notices of upcoming changes and in the mean time, everything will still work as expected.
In this case, the notice announces that the sniff will be removed in PHPCS 4.0, so that means that when WordPressCS is being made compatible with PHPCS 4.0, the sniff will need to be removed from the WordPressCS ruleset.
Until that time, this notice is nothing to be concerned about. If it annoys you, you can run PHPCS with the -q ("quiet") flag to not see it.
@mikemanger It is possible to exclude the sniff from WordPress rules in your own phpcs.xml file. The warning will not be shown. But, of course, the sniff will be removed from the validation.
<rule ref="WordPress">
<exclude name="Generic.Functions.CallTimePassByReference" />
</rule>